or any way to not redirect to my acccount page aft...
# suitecommerce
m
or any way to not redirect to my acccount page afte logging in?
s
I don't think I mention your specific use case but I talk about redirects here: https://developers.suitecommerce.com/control-page-navigation-and-redirection
I forget exactly where we set the code to determine where a user is directed after a successful login. It could very well be the SSP
But I think it should be possible to just pass in a hash as URL parameter
d
The Commerce API logIn(customer) redirect URL tends to be a bit unpredictable. If there's a way to control the redirect, it'd be really useful if it was documented in a Suiteanswer
m
Awesome thanks guys!
s
Copy code
// Assuming that `container` has been passed in to the `mountToApp` of an extension
var login = container.getComponent('Environment').getSiteSetting('touchpoints.login');
var origin = container.getComponent('Environment').getConfig('currentTouchpoint');
var hash = Backbone.history.fragment;

var loginUrl = login + '&origin=' + origin + '&origin_hash=' + hash;
Working on an example to update the page with and this is the code I'm going to use
It creates a new login URL and 'bookmarks' the existing page the user is looking at by adding it to the URL
After successfully logging in, the user will be taken back to the page they were looking at
👀 1
✅ 1
m
WOW thanks thats awesome! I really appreciate the help!