improve login page
This commit is contained in:
parent
4ac0001795
commit
116d0577a7
6 changed files with 238 additions and 34 deletions
|
@ -5,3 +5,9 @@ export type AuthResponse = {
|
|||
token: string;
|
||||
expires_at: string;
|
||||
};
|
||||
|
||||
export type AuthUrls = {
|
||||
discord?: string;
|
||||
google?: string;
|
||||
tumblr?: string;
|
||||
};
|
||||
|
|
|
@ -39,6 +39,8 @@ export default async function serverRequest<T>(
|
|||
return (await resp.json()) as T;
|
||||
}
|
||||
|
||||
export const getToken = (req: Request) => getCookie(req, "pronounscc-token");
|
||||
|
||||
export function getCookie(req: Request, cookieName: string): string | undefined {
|
||||
const header = req.headers.get("Cookie");
|
||||
if (!header) return undefined;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue