oauth init by guest hotfix

This commit is contained in:
SleepWalker 2016-02-27 21:58:36 +02:00
parent ced721af24
commit edb027a6a5

View File

@ -166,6 +166,13 @@ export function oAuthComplete(params = {}) {
typeof params.accept === 'undefined' ? {} : {accept: params.accept} typeof params.accept === 'undefined' ? {} : {accept: params.accept}
) )
.then((resp) => { .then((resp) => {
if (resp.status === 401 && resp.name === 'Unauthorized') {
// TODO: temporary solution for oauth init by guest
// TODO: request serivce should handle http status codes
dispatch(routeActions.push('/oauth/permissions'));
return;
}
if (resp.redirectUri) { if (resp.redirectUri) {
location.href = resp.redirectUri; location.href = resp.redirectUri;
} }