Доработано поведение для идентификации статичного редиректа

This commit is contained in:
ErickSkrauch 2016-03-20 22:36:30 +03:00
parent 9fc22211e0
commit 1e9b48bd9b
2 changed files with 7 additions and 9 deletions

View File

@ -192,7 +192,9 @@ export function oAuthComplete(params = {}) {
}
})
.then((resp) => {
if (resp.redirectUri === 'static_page' || resp.redirectUri === 'static_page_with_code') {
if (resp.redirectUri.startsWith('static_page')) {
resp.code = resp.redirectUri.match(/code=(.+)&/)[1];
resp.redirectUri = resp.redirectUri.match(/^(.+)\?/)[1];
resp.displayCode = resp.redirectUri === 'static_page_with_code';
dispatch(setOAuthCode({
success: resp.success,

View File

@ -33,14 +33,10 @@ export default class CompleteState extends AbstractState {
data.accept = this.isPermissionsAccepted;
}
context.run('oAuthComplete', data).then((resp) => {
switch (resp.redirectUri) {
case 'static_page':
case 'static_page_with_code':
context.setState(new FinishState());
break;
default:
location.href = resp.redirectUri;
break;
if (resp.redirectUri.startsWith('static_page')) {
context.setState(new FinishState());
} else {
location.href = resp.redirectUri;
}
}, (resp) => {
// TODO