2017-10-13 19:31:05 +00:00
|
|
|
// @flow
|
2017-04-21 10:00:50 +00:00
|
|
|
|
2018-06-26 22:56:22 +00:00
|
|
|
import { SET_JWT } from './actionTypes';
|
2017-04-21 10:00:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Stores a specific JSON Web Token (JWT) into the redux store.
|
|
|
|
*
|
2017-10-13 19:31:05 +00:00
|
|
|
* @param {string} [jwt] - The JSON Web Token (JWT) to store.
|
2017-04-21 10:00:50 +00:00
|
|
|
* @returns {{
|
|
|
|
* type: SET_TOKEN_DATA,
|
2017-10-13 19:31:05 +00:00
|
|
|
* jwt: (string|undefined)
|
2017-04-21 10:00:50 +00:00
|
|
|
* }}
|
|
|
|
*/
|
2017-10-13 19:31:05 +00:00
|
|
|
export function setJWT(jwt: ?string) {
|
2017-04-21 10:00:50 +00:00
|
|
|
return {
|
|
|
|
type: SET_JWT,
|
|
|
|
jwt
|
|
|
|
};
|
|
|
|
}
|