UNPKG

@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.

21 lines 736 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sign = void 0; const rotating_credential_1 = require("../rotating-credential"); const index_1 = require("./index"); const sign = (keys) => { const credential = new rotating_credential_1.RotatingCredential(keys); return async (cookie) => { const value = (0, index_1.toBase64)(cookie.value); const hash = await credential.sign(value); return { signedCookie: { name: cookie.name, value }, signatureCookie: { name: (0, index_1.getSignatureCookieName)(cookie.name), value: hash, }, }; }; }; exports.sign = sign; //# sourceMappingURL=sign.js.map