2017-02-13 9 views
0

ユーザをリダイレクトせずに簡単な認証を使用してログインする方法を教えてください。Ember Simple Authを使用してリダイレクトせずにログイン

認証コードは次のようになります。

session.authenticate(
    'authenticator:oauth2-password-grant', 
    identification, 
    password, 
    ['read', 'write'] 
) 

しかし、それは理由私のenvironment.jsファイル内の設定をリダイレクトします。

ENV['ember-simple-auth'] = { 
    authenticationRoute: 'login', 
    routeAfterAuthentication: 'accounts.index', 
    routeIfAlreadyAuthenticated: 'accounts.index' 
}; 

私がに追加できるパラメータまたは何かがありますこのrouterAfterAuthenticationをバイパスするための認証コール?

答えて

0

適用ルートでは、sessionAuthenticatedメソッドをオーバーライドします。

あなたはApplicationRouteMixin

//routes/application.js 

... 
sessionAuthenticated(){ 
    //do nothing or whatever 
} 
... 
を使用しているため routeAfterAuthenticationへの移行は、そこで行われています
関連する問題