Created
February 28, 2016 18:58
-
-
Save mattiamanzati/0001706ea804c4b6ef28 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Triggered whenever the user clicks the login submit button | |
export const LOGIN_SUBMIT = 'core_auth/LOGIN_SUBMIT'; | |
export function loginSubmit(data){ | |
return { | |
type: LOGIN_SUBMIT, | |
payload: data | |
}; | |
} | |
// Triggered whenever a login request is dispatched from whenever point in the code | |
export const LOGIN_REQUEST = 'core_auth/LOGIN_REQUEST'; | |
export function loginRequest(data){ | |
return { | |
type: LOGIN_REQUEST, | |
payload: data | |
}; | |
} | |
// triggered when the login has succeded | |
export const LOGIN_SUCCESS = 'core_auth/LOGIN_SUCCESS'; | |
export function loginSuccess(data){ | |
return { | |
type: LOGIN_SUCCESS, | |
payload: data | |
}; | |
} | |
// triggered when the login failed | |
export const LOGIN_ERROR = 'core_auth/LOGIN_ERROR'; | |
export function loginError(errors){ | |
return { | |
type: LOGIN_ERROR, | |
error: true, | |
payload: errors | |
}; | |
} | |
// triggered to logout the user | |
export const LOGOUT = 'core_auth/LOGOUT'; | |
export function logout(){ | |
return { | |
type: LOGOUT | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment