Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix(actions): no pending for Login Auth
Browse files Browse the repository at this point in the history
fix(actions): no pending for Login Auth
  • Loading branch information
Metnew committed Dec 5, 2017
1 parent cf5067e commit 84f8aa8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/common/actions/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import {awral} from 'actions/utils'
import {loginAPI} from 'api/AuthSvc'
import {setLocalToken, resetLocalToken} from 'api/LocalStorageCookiesSvc'

export const LOGIN_AUTH_PENDING = 'LOGIN_AUTH_PENDING'
export const LOGIN_AUTH_SUCCESS = 'LOGIN_AUTH_SUCCESS'
export const LOGIN_AUTH_FAIL = 'LOGIN_AUTH_FAIL'

export type LOGIN_AUTH_PENDING_TYPE = {type: 'LOGIN_AUTH_PENDING'}
export type LOGIN_AUTH_SUCCESS_TYPE = {
type: 'LOGIN_AUTH_SUCCESS',
payload: {token: string}
Expand All @@ -28,9 +26,10 @@ export type LOGOUT_AUTH_SUCCESS_TYPE = {type: 'LOGOUT_AUTH_SUCCESS'}
{@link https://github.com/Metnew/awral}
*/
const awralLogin = awral.of({
success ({payload, dispatch, meta}) {
pending: null,
success ({payload, dispatch}) {
setLocalToken(payload.token)
dispatch({type: LOGIN_AUTH_SUCCESS, payload, meta})
dispatch({type: LOGIN_AUTH_SUCCESS, payload})
}
})

Expand Down

0 comments on commit 84f8aa8

Please sign in to comment.