@ExpDev07 wrote:
Hey! I’ve got my /login route setup like this:
import Route from '@ember/routing/route'; import UnauthenticatedRouteMixin from 'ember-simple-auth/mixins/unauthenticated-route-mixin'; import OAuth2ImplicitGrantCallbackRouteMixin from 'ember-simple-auth/mixins/oauth2-implicit-grant-callback-route-mixin'; export default Route.extend(UnauthenticatedRouteMixin, OAuth2ImplicitGrantCallbackRouteMixin, { authenticator: 'authenticator:oauth2' });
And authentication works! When my server redirects the user to “{host}:{port}/login#access_token=abc”, they do get authenticated.
/** * {@inheritdoc} */ public function authenticated(Request $request, SteamUser $steam) { // Get or create the authenticating user from their steam details. $user = $this->get_or_create_user($steam); return response()->redirectTo('/login#access_token=' . $user->api_token); }
However, it does not redirect them to the “routeIfAlreadyAuthenticated”. For that to happen, I must manually click refresh, in which they get redirected. It should work like I have, right? The two mixins should not override each other?
Any help is appreciated!!
Posts: 1
Participants: 1