Skip to content

Commit fbd71b6

Browse files
committed
fixed README
1 parent 57a4b63 commit fbd71b6

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,24 @@ Auth is created as a singleton object. This is because the Module Worker syntax
120120

121121
See official document for project ID: https://firebase.google.com/docs/projects/learn-more#project-identifiers
122122

123-
### `authObj.verifyIdToken(idToken: string, env?: EmulatorEnv): Promise<FirebaseIdToken>`
123+
### `authObj.verifyIdToken(idToken: string, checkRevoked?: boolean, env?: EmulatorEnv): Promise<FirebaseIdToken>`
124124

125125
Verifies a Firebase ID token (JWT). If the token is valid, the promise is fulfilled with the token's decoded claims; otherwise, the promise is rejected.
126126

127127
See the [ID Token section of the OpenID Connect spec](http://openid.net/specs/openid-connect-core-1_0.html#IDToken) for more information about the specific properties below.
128128

129129
- `idToken` The ID token to verify.
130+
- `checkRevoked` - Whether to check if the session cookie was revoked. This requires an extra request to the Firebase Auth backend to check the `tokensValidAfterTime` time for the corresponding user. When not specified, this additional check is not performed.
130131
- `env` is an optional parameter. but this is using to detect should use emulator or not.
131132

132-
### `authObj.verifySessionCookie(sessionCookie: string, env?: EmulatorEnv): Promise<FirebaseIdToken>`
133+
### `authObj.verifySessionCookie(sessionCookie: string, checkRevoked?: boolean, env?: EmulatorEnv): Promise<FirebaseIdToken>`
133134

134135
Verifies a Firebase session cookie. Returns a Promise with the cookie claims. Rejects the promise if the cookie could not be verified.
135136

136137
See [Verify Session Cookies](https://firebase.google.com/docs/auth/admin/manage-cookies#verify_session_cookie_and_check_permissions) for code samples and detailed documentation.
137138

138139
- `sessionCookie` The session cookie to verify.
140+
- `checkRevoked` - Whether to check if the session cookie was revoked. This requires an extra request to the Firebase Auth backend to check the `tokensValidAfterTime` time for the corresponding user. When not specified, this additional check is not performed.
139141
- `env` is an optional parameter. but this is using to detect should use emulator or not.
140142

141143
### `authObj.createSessionCookie(idToken: string, sessionCookieOptions: SessionCookieOptions, env?: EmulatorEnv): Promise<string>`
@@ -148,6 +150,28 @@ Creates a new Firebase session cookie with the specified options. The created JW
148150

149151
**Required** service acccount credential to use this API. You need to set the credentials with `Auth.getOrInitialize`.
150152

153+
### `authObj.getUser(uid: string, env?: EmulatorEnv): Promise<UserRecord>`
154+
155+
Gets the user data for the user corresponding to a given `uid`.
156+
157+
- `uid` corresponding to the user whose data to fetch.
158+
- `env` is an optional parameter. but this is using to detect should use emulator or not.
159+
160+
### `authObj.revokeRefreshTokens(uid: string, env?: EmulatorEnv): Promise<void>`
161+
162+
Revokes all refresh tokens for an existing user.
163+
164+
- `uid` corresponding to the user whose refresh tokens are to be revoked.
165+
- `env` is an optional parameter. but this is using to detect should use emulator or not.
166+
167+
### `authObj.setCustomUserClaims(uid: string, customUserClaims: object | null, env?: EmulatorEnv): Promise<void>`
168+
169+
Sets additional developer claims on an existing user identified by the provided `uid`, typically used to define user roles and levels of access. These claims should propagate to all devices where the user is already signed in (after token expiration or when token refresh is forced) and the next time the user signs in. If a reserved OIDC claim name is used (sub, iat, iss, etc), an error is thrown. They are set on the authenticated user's ID token JWT.
170+
171+
- `uid` - The `uid` of the user to edit.
172+
- `customUserClaims` The developer claims to set. If null is passed, existing custom claims are deleted. Passing a custom claims payload larger than 1000 bytes will throw an error. Custom claims are added to the user's ID token which is transmitted on every authenticated request. For profile non-access related user attributes, use database or other separate storage systems.
173+
- `env` is an optional parameter. but this is using to detect should use emulator or not.
174+
151175
### `WorkersKVStoreSingle.getOrInitialize(cacheKey: string, cfKVNamespace: KVNamespace): WorkersKVStoreSingle`
152176

153177
WorkersKVStoreSingle is created as a singleton object. This is because the Module Worker syntax only use environment variables at the time of request.
@@ -236,4 +260,4 @@ Access to `/admin/login` after started up Emulator and created an account (email
236260

237261
### Required service account key.
238262

239-
- [ ] Check authorized user is deleted (revoked)
263+
- [x] Check authorized user is deleted (revoked)

0 commit comments

Comments
 (0)