forked from baron/baron-sso
테넌트 목록 조회 cursor기반으로 재구성. 사용자 metadata 미사용 필드 제거
This commit is contained in:
@@ -11,6 +11,13 @@ export type CommonOidcConfigOptions<TUserStore = unknown> = {
|
||||
userStore: TUserStore;
|
||||
};
|
||||
|
||||
export type LoginRedirectGuardParams = {
|
||||
pathname: string;
|
||||
isRedirecting: boolean;
|
||||
loginPath?: string;
|
||||
callbackPath?: string;
|
||||
};
|
||||
|
||||
type CommonOidcRuntimeConfig<TUserStore> = {
|
||||
authority: string;
|
||||
client_id: string;
|
||||
@@ -61,3 +68,20 @@ export function buildCommonUserManagerSettings<
|
||||
redirect_uri: config.redirect_uri || "",
|
||||
};
|
||||
}
|
||||
|
||||
export function shouldStartLoginRedirect({
|
||||
pathname,
|
||||
isRedirecting,
|
||||
loginPath = "/login",
|
||||
callbackPath = DEFAULT_OIDC_REDIRECT_PATH,
|
||||
}: LoginRedirectGuardParams) {
|
||||
if (isRedirecting) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pathname === loginPath || pathname.startsWith(callbackPath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user