@pedwise/next-firebase-auth-edge
Version:
Next.js 13 Firebase Authentication for Edge and server runtimes. Dedicated for Next 13 server components. Compatible with Next.js middleware.
22 lines (17 loc) • 443 B
text/typescript
export const toBase64 = (value: string) => {
return btoa(value).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
};
export const base64ToString = (value: string) => {
return atob(value);
};
export const getSignatureCookieName = (name: string) => {
return `${name}.sig`;
};
export interface Cookie {
name: string;
value: string;
}
export interface SignCookieResult {
signedCookie: Cookie;
signatureCookie: Cookie;
}