mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-16 01:46:38 +00:00
add my-device and force login
This commit is contained in:
@@ -5,15 +5,17 @@ import { AxiosResponse } from "axios";
|
||||
import { pullEnv } from "../pullEnv";
|
||||
|
||||
export async function verifySession({
|
||||
skipCheckVerifyEmail
|
||||
skipCheckVerifyEmail,
|
||||
forceLogin
|
||||
}: {
|
||||
skipCheckVerifyEmail?: boolean;
|
||||
forceLogin?: boolean;
|
||||
} = {}): Promise<GetUserResponse | null> {
|
||||
const env = pullEnv();
|
||||
|
||||
try {
|
||||
const res = await internal.get<AxiosResponse<GetUserResponse>>(
|
||||
"/user",
|
||||
`/user${forceLogin ? "?forceLogin=true" : ""}`,
|
||||
await authCookieHeader()
|
||||
);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ const patterns: PatternConfig[] = [
|
||||
{ name: "Invite Token", regex: /^\/invite\?token=[a-zA-Z0-9-]+$/ },
|
||||
{ name: "Setup", regex: /^\/setup$/ },
|
||||
{ name: "Resource Auth Portal", regex: /^\/auth\/resource\/\d+$/ },
|
||||
{ name: "Device Login", regex: /^\/auth\/login\/device$/ }
|
||||
{ name: "Device Login", regex: /^\/auth\/login\/device(\?code=[a-zA-Z0-9-]+)?$/ }
|
||||
];
|
||||
|
||||
export function cleanRedirect(input: string, fallback?: string): string {
|
||||
|
||||
Reference in New Issue
Block a user