Ember simple auth: 认证后如何重定向回上次访问的路由?

Ember simple auth: how to redirect back to the last visiting route after authentication?

如果用户试图访问 /protected-route,然后在 /login 路由上完成用户身份验证后使用 ember-simple-auth,如何将用户重定向回 /protected-route

有定义认证后路由的配置,但是如何实现这样的事情?

您应该将 ApplicationRouteMixin 混合到应用程序路由中,用户将在登录后转换为 protected route

有关详细信息,请参阅 ApplicationRouteMixin 文档 http://ember-simple-auth.com/api/classes/ApplicationRouteMixin.htmlsessionAuthenticated 方法