@enkeldigital/firebase-authentication
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -10,5 +10,5 @@ import type { Auth, DecodedIdToken } from "firebase-admin/auth"; | ||
} | ||
declare const _default: (firebaseAuth: Auth) => (req: Request) => Promise<boolean | { | ||
declare const _default: (firebaseAuth: Auth, checkRevoked?: boolean) => (req: Request) => Promise<boolean | { | ||
error: string; | ||
}>; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = (firebaseAuth) => async (req) => { | ||
exports.default = (firebaseAuth, checkRevoked = false) => async (req) => { | ||
if (!req.headers.authorization) | ||
@@ -9,4 +9,4 @@ return { error: "Missing auth header" }; | ||
return { error: "Expected Bearer Authentication Scheme" }; | ||
req.jwt = await firebaseAuth.verifyIdToken(tokenString); | ||
req.jwt = await firebaseAuth.verifyIdToken(tokenString, checkRevoked); | ||
return true; | ||
}; |
{ | ||
"name": "@enkeldigital/firebase-authentication", | ||
"description": "Library to create Express JS authentication and authorization middlewares", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"main": "./dist/index.js", | ||
@@ -6,0 +6,0 @@ "types": "./dist", |
@@ -15,2 +15,4 @@ # @enkeldigital/firebase-authentication | ||
## Example | ||
View [samples](./samples) folder for more specific examples | ||
1. Make a API call from client [using this example](https://github.com/Enkel-Digital/simpler-fetch/blob/master/firebase-auth.md) to include an Authorization header | ||
@@ -17,0 +19,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5488
61