mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-17 01:37:26 +00:00
include default credentials state on auth failure
This commit is contained in:
parent
8d40c04107
commit
0ce26e4479
@ -200,7 +200,12 @@ function compilingContract(state = false, action) {
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_CREDENTIALS_STATE = {host: DEFAULT_HOST, token: '', authenticated: false, authenticating: false};
|
const DEFAULT_CREDENTIALS_STATE = {
|
||||||
|
host: process.env.NODE_ENV === 'development' ? DEFAULT_HOST : window.location.host,
|
||||||
|
token: '',
|
||||||
|
authenticated: false,
|
||||||
|
authenticating: false
|
||||||
|
};
|
||||||
|
|
||||||
function credentials(state = DEFAULT_CREDENTIALS_STATE, action) {
|
function credentials(state = DEFAULT_CREDENTIALS_STATE, action) {
|
||||||
if (action.type === LOGOUT[SUCCESS]) {
|
if (action.type === LOGOUT[SUCCESS]) {
|
||||||
@ -208,7 +213,7 @@ function credentials(state = DEFAULT_CREDENTIALS_STATE, action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (action.type === AUTHENTICATE[FAILURE]) {
|
if (action.type === AUTHENTICATE[FAILURE]) {
|
||||||
return {error: action.error, authenticated: false, authenticating: false};
|
return {error: action.error, ...DEFAULT_CREDENTIALS_STATE};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action.type === AUTHENTICATE[SUCCESS]) {
|
if (action.type === AUTHENTICATE[SUCCESS]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user