Skip to content

Commit a7293a8

Browse files
committed
fix: add support start_oauth
1 parent cd1e824 commit a7293a8

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

adminforth/spa/src/utils/utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const LS_LANG_KEY = `afLanguage`;
2121
const MAX_CONSECUTIVE_EMPTY_RESULTS = 2;
2222
const ITEMS_PER_PAGE_LIMIT = 100;
2323
const AUTOLOGIN_QUERY_PARAM = 'autologin';
24+
const START_OAUTH_QUERY_PARAM = 'start_oauth';
2425

2526
export function getAutologinCredentials(autologin: unknown): { username: string, password: string } | null {
2627
if (typeof autologin !== 'string') {
@@ -117,6 +118,12 @@ export async function redirectToLogin() {
117118
if (currentPath !== '/login' && currentPath !== homePagePath) {
118119
query.next = next;
119120
}
121+
122+
const currentQuery = router.currentRoute.value.query;
123+
124+
if (START_OAUTH_QUERY_PARAM in currentQuery) {
125+
query[START_OAUTH_QUERY_PARAM] = (currentQuery[START_OAUTH_QUERY_PARAM] as string) ?? '';
126+
}
120127

121128
await router.push({ name: 'login', query });
122129
}

0 commit comments

Comments
 (0)