mirror of
https://github.com/tinyauthapp/tinyauth.git
synced 2026-08-29 09:23:32 +08:00
18 lines
392 B
TypeScript
18 lines
392 B
TypeScript
type UseLoginForProps = {
|
|
login_for?: "oidc" | "app";
|
|
compiledParams: string;
|
|
};
|
|
|
|
export const useLoginFor = (props: UseLoginForProps): string => {
|
|
const { login_for, compiledParams } = props;
|
|
|
|
switch (login_for) {
|
|
case "oidc":
|
|
return "/oidc/authorize" + compiledParams;
|
|
case "app":
|
|
return "/continue" + compiledParams;
|
|
default:
|
|
return "/logout";
|
|
}
|
|
};
|