@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.
19 lines • 671 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.get = void 0;
const rotating_credential_1 = require("../rotating-credential");
const index_1 = require("./index");
const get = (keys) => {
const credential = new rotating_credential_1.RotatingCredential(keys);
return async ({ signatureCookie, signedCookie, }) => {
if (!(await credential.verify(signedCookie.value, signatureCookie.value))) {
return null;
}
return {
name: signedCookie.name,
value: (0, index_1.base64ToString)(signedCookie.value),
};
};
};
exports.get = get;
//# sourceMappingURL=get.js.map