Receive authorization modal (instead of alert
This commit is contained in:
@ -199,6 +199,14 @@ export function refreshingToken(){
|
||||
}
|
||||
}
|
||||
|
||||
export function importAuthorization(data){
|
||||
return {
|
||||
type: 'SPOTIFY_IMPORT_AUTHORIZATION',
|
||||
user: data.user,
|
||||
authorization: data.authorization
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get current user
|
||||
|
||||
@ -46,6 +46,17 @@ export default function reducer(spotify = {}, action){
|
||||
me: false
|
||||
})
|
||||
|
||||
case 'SPOTIFY_IMPORT_AUTHORIZATION':
|
||||
return Object.assign({}, spotify, {
|
||||
authorizing: false,
|
||||
authorized: true,
|
||||
authorization: action.authorization,
|
||||
access_token: action.authorization.access_token,
|
||||
refresh_token: action.authorization.refresh_token,
|
||||
token_expiry: action.authorization.token_expiry,
|
||||
me: action.user
|
||||
})
|
||||
|
||||
case 'SPOTIFY_TOKEN_REFRESHING':
|
||||
return Object.assign({}, spotify, { refreshing_token: true })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user