You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ember-simple-auth supports retrying transitions after the session is authenticated, but this only works if the page isn't refreshed. session.attemptedTransition isn't persisted, so the info is gone after a reload.
ember-simple-auth does already support a cookie-based retry, but that is only enabled during FastBoot. Would it be an option to either always use this cookie-based setup, or make it an opt-in somehow?
Our use-case
We have an authenticator that redirects users to an authentication server on a different domain (which then redirects back to the app with a token), but as a result the original transition information is lost.
We can hook into the cookie-based redirect setup by writing the url to the ember_simple_auth-redirectTarget cookie ourselves (in the overriden requireAuthentication method of our app's SessionService). But it would be nice if this wouldn't require custom app code.
Code of our workaround
exportdefaultclassSessionServiceextendsBaseSessionService{
@servicerouter;requireAuthentication(transition,routeOrCallback){constisAuthenticated=super.requireAuthentication(transition,routeOrCallback);if(!isAuthenticated){constCOOKIE_NAME='ember_simple_auth-redirectTarget';constredirectUrl=routeInfoUrl(transition.to,this.router);// This is a util that reimplements `transition.intent.url` with public APIsdocument.cookie=`${COOKIE_NAME}=${redirectUrl};path=/;samesite=strict`;}returnisAuthenticated;}
The text was updated successfully, but these errors were encountered:
ember-simple-auth supports retrying transitions after the session is authenticated, but this only works if the page isn't refreshed.
session.attemptedTransition
isn't persisted, so the info is gone after a reload.ember-simple-auth does already support a cookie-based retry, but that is only enabled during FastBoot. Would it be an option to either always use this cookie-based setup, or make it an opt-in somehow?
Our use-case
We have an authenticator that redirects users to an authentication server on a different domain (which then redirects back to the app with a token), but as a result the original transition information is lost.
We can hook into the cookie-based redirect setup by writing the url to the
ember_simple_auth-redirectTarget
cookie ourselves (in the overridenrequireAuthentication
method of our app's SessionService). But it would be nice if this wouldn't require custom app code.Code of our workaround
The text was updated successfully, but these errors were encountered: