How can I redirect customers to their cart after signing up?

Hello, I would like to redirect customer to their cart after account sign-up. I have already done so when they login inside the main-login.liquid file using this code:

I would like to do the same with this page, but that code does not seem to work anywhere I place it in the main-activate-account.liquid this is the current code:

{{ 'customer.css' | asset_url | stylesheet_tag }}

{%- style -%}
  .section-{{ section.id }}-padding {
    padding-top: {{ section.settings.padding_top | times: 0.75 | round: 0 }}px;
    padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px;
  }

  @media screen and (min-width: 750px) {
    .section-{{ section.id }}-padding {
      padding-top: {{ section.settings.padding_top }}px;
      padding-bottom: {{ section.settings.padding_bottom }}px;
    }
  }
{%- endstyle -%}

  
  # 
    {{ 'customer.activate_account.title' | t }}
  
  

    {{ 'customer.activate_account.subtext' | t }}
  

   {% form 'activate_customer_password'%}
    {%- if form.errors -%}
      
      ## 
        
        {{ 'templates.contact.form.error_heading' | t }}
      
      
        {%- for field in form.errors -%}
          - {%- if field == 'form' -%}
                {{ form.errors.messages[field] }}
              {%- else -%}
              
                  {{ form.errors.translated_fields[field] | capitalize }}
                  {{ form.errors.messages[field] }}
              
              {%- endif -%}
          
        {%- endfor -%}
      

    {%- endif -%}

    
      
      
      {%- if form.errors contains 'password' -%}
        <small>
          
          {{ form.errors.translated_fields.password | capitalize }}
          {{ form.errors.messages.password }}
        </small>
      {%- endif -%}
    

    
      
       
      {%- if form.errors contains 'password_confirmation' -%}
        <small>
          
          {{ form.errors.translated_fields.password_confirmation | capitalize }}
          {{ form.errors.messages.password_confirmation }}
        </small>
      {%- endif -%}
    
    

 
    
    
             
{% endform %}

{% schema %}
{
  "name": "t:sections.main-activate-account.name",
  "settings": [
    {
      "type": "header",
      "content": "t:sections.all.padding.section_padding_heading"
    },
    {
      "type": "range",
      "id": "padding_top",
      "min": 0,
      "max": 100,
      "step": 4,
      "unit": "px",
      "label": "t:sections.all.padding.padding_top",
      "default": 36
    },
    {
      "type": "range",
      "id": "padding_bottom",
      "min": 0,
      "max": 100,
      "step": 4,
      "unit": "px",
      "label": "t:sections.all.padding.padding_bottom",
      "default": 36
    }
  ]
}
{% endschema %}

I have taken a look at this guide and tried to use the example to go off of but didn’t work:
https://shopify.dev/docs/themes/architecture/templates/customers-register