mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-27 15:30:37 +05:30
Доработано поведение для идентификации статичного редиректа
This commit is contained in:
parent
9fc22211e0
commit
1e9b48bd9b
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user