mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
feat: login policy hook for plugins and optional https redirect (#1584)
This commit is contained in:
1 parent
34a9c77114
commit
ad46f42ab1
53 files changed
+15250
-59
No files matched your search
@@ -46,6 +46,16 @@ export async function getLoginMethods(): Promise<PublicLoginMethod[]> {
|
||||
}
|
||||
}
|
||||
|
||||
/** False when the login policy turned remember me off. Public. */
|
||||
export async function getRememberDeviceAllowed(): Promise<boolean> {
|
||||
try {
|
||||
const response = await authApi.get("/users/auth/methods");
|
||||
return response.data?.rememberDevice !== false;
|
||||
} catch {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export async function submitLoginMethod(
|
||||
methodId: string,
|
||||
body: Record<string, unknown>,
|
||||
|
||||
Reference in new issue
Block a user