mirror of
https://github.com/pawelmalak/flame.git
synced 2025-08-07 03:35:18 +02:00
Moved auth form. Added auto login and logout functionality
This commit is contained in:
parent
1571981252
commit
d1c61bb393
18 changed files with 311 additions and 98 deletions
|
@ -28,6 +28,18 @@ export const authReducer = (
|
|||
token: null,
|
||||
isAuthenticated: false,
|
||||
};
|
||||
case ActionType.autoLogin:
|
||||
return {
|
||||
...state,
|
||||
token: action.payload,
|
||||
isAuthenticated: true,
|
||||
};
|
||||
case ActionType.authError:
|
||||
return {
|
||||
...state,
|
||||
token: null,
|
||||
isAuthenticated: false,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue