From edb027a6a5da1a71c517d4695b5019e3ce67d013 Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Sat, 27 Feb 2016 21:58:36 +0200 Subject: [PATCH] oauth init by guest hotfix --- src/components/auth/actions.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/auth/actions.js b/src/components/auth/actions.js index c07ab9e..f477eda 100644 --- a/src/components/auth/actions.js +++ b/src/components/auth/actions.js @@ -166,6 +166,13 @@ export function oAuthComplete(params = {}) { typeof params.accept === 'undefined' ? {} : {accept: params.accept} ) .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) { location.href = resp.redirectUri; }