[英]Redirect if already authenticated - ember simple auth
I have registration and login working for my Ember app but for some reason 'routeIfAlreadyAuthenticated' is not working currently. 我已经为我的Ember应用程序进行了注册和登录,但是由于某种原因'routeIfAlreadyAuthenticated'目前无法正常工作。 Here is my setup: 这是我的设置:
config/environment.js
'ember-simple-auth': {
authenticationRoute: 'auth.login',
routeIfAlreadyAuthenticated: 'rows',
routeAfterAuthentication: 'rows'
}
But if I go to say /auth/login
after I'm signed in it doesn't redirect me to the rows
route. 但是,如果我在/auth/login
后说/auth/login
,它不会将我重定向到rows
路由。 Does anybody know what I could be doing wrong? 有人知道我会做错什么吗?
Your login route should extend unauthenticated-route-mixin
mixin: 您的登录路由应扩展unauthenticated-route-mixin
身份unauthenticated-route-mixin
mixin:
import Route from '@ember/routing/route';
import UnauthenticatedRouteMixin from 'ember-simple-auth/mixins/unauthenticated-route-mixin';
export default Route.extend(UnauthenticatedRouteMixin, {
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.