initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { cookies } from "next/headers";
|
||||
import { cookieConfig } from "./cookieConfig";
|
||||
|
||||
export async function setTokens(accessToken: string, refreshToken: string, ttl: number) {
|
||||
const store = await cookies();
|
||||
store.set("access_token", accessToken, { ...cookieConfig, path: "/", maxAge: ttl });
|
||||
store.set("refresh_token", refreshToken, { ...cookieConfig, path: "/", maxAge: ttl * 7 });
|
||||
}
|
||||
|
||||
export async function deleteOAuthCookies() {
|
||||
const store = await cookies();
|
||||
store.delete("pkce_verifier");
|
||||
store.delete("oauth_state");
|
||||
}
|
||||
Reference in New Issue
Block a user