Fail if user errors
This commit is contained in:
parent
4de1a6682c
commit
816e21e4b7
1 changed files with 4 additions and 0 deletions
|
@ -52,6 +52,10 @@ const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
|
|||
TokenAuthVariables
|
||||
>(tokenAuthMutation, {
|
||||
onCompleted: result => {
|
||||
if (result.tokenCreate.errors.length > 0) {
|
||||
logout();
|
||||
}
|
||||
|
||||
const user = result.tokenCreate.user;
|
||||
|
||||
// FIXME: Now we set state also when auth fails and returned user is
|
||||
|
|
Loading…
Reference in a new issue