2017-06-08 17 views
0

あなたがAORでやった素晴らしい仕事のおかげで、これは私にとって素晴らしいインスピレーションの源泉でした。悪い要求の場合はログアウトしてください

私の質問: 悪い要求(コード400)を行った場合、AORはアプリからログアウトします。 これを防止し、代わりにユーザーに通知を表示するにはどうすればよいですか?

答えて

1

あなたはそれを達成するためにinstructionsに従うことができます:

import { AUTH_ERROR } from 'admin-on-rest'; 

export default (type, params) => { 
    if (type === AUTH_ERROR) { 
     // As I noticed, this code is executed for any error, not only for auth-one. 
     // So process the error as you wish (show message), don't log out. 
    } 
    // Then resolve the promise. 
    return Promise.resolve(); 
}; 
関連する問題