mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-06-14 15:30:16 +00:00
a0e74cd5f2
Co-authored-by: Claude <noreply@anthropic.com>
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";
|
|
}
|
|
};
|