Redirect to customer account page after login

I have a full page extension that I want to redirect customers to after login.

I figured I could do something like:

<a href="/customer_authentication/login?return_to={{ routes.account_url | append: '/pages/<extension ID>' | url_encode }}">
  Log in
</a>

This doesn’t seem to work and instead sends the user to the orders page. The docs say that it can only handle redirects to the “online store”, which makes sense, but I feel like this should be an option.

1 Like

Hi Kyle,

I feel that this may be intentional behaviour, but let me doublecheck with the customer account extensibility team.

2 Likes

Hey Kyle, here are the docs on how to link to a specific full page extension.

@Kenza_Iraki, just to clarify, we have already tried using this method which works if a customer is already logged in, but does not seem to work for redirecting customers after login. Can you confirm if that’s the expected behavior or if there’s something we’re missing here? Thanks!

We have specifically tried all of the following:

<a href="{{ routes.account_url }}/pages/extensionId">Account Extension</a>

<a href="{{ routes.account_login_url }}/pages/extensionId">Account Extension</a>

<a href="/customer_authentication/login?return_to={{ routes.account_url | append: '/pages/extension ID' | url_encode }}"> Log in</a>