Skip to content

Commit e7ab2f0

Browse files
authored
fix: Update comments in index files (#1414)
* add comments in index files * change signature in firebase-admin-node * small fixes * small fixes * fixes
1 parent 973e68b commit e7ab2f0

File tree

3 files changed

+30
-22
lines changed

3 files changed

+30
-22
lines changed

etc/firebase-admin.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export namespace auth {
152152
updateProviderConfig(providerId: string, updatedConfig: UpdateAuthProviderRequest): Promise<AuthProviderConfig>;
153153
updateUser(uid: string, properties: UpdateRequest): Promise<UserRecord>;
154154
verifyIdToken(idToken: string, checkRevoked?: boolean): Promise<DecodedIdToken>;
155-
verifySessionCookie(sessionCookie: string, checkForRevocation?: boolean): Promise<DecodedIdToken>;
155+
verifySessionCookie(sessionCookie: string, checkRevoked?: boolean): Promise<DecodedIdToken>;
156156
}
157157
export interface BaseAuthProviderConfig {
158158
displayName?: string;

src/auth/auth.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ export class BaseAuth<T extends AbstractAuthRequestHandler> implements BaseAuthI
104104
}
105105

106106
/**
107-
* Verifies a JWT auth token. Returns a promise with the tokens claims.
107+
* Verifies a JWT auth token. Returns a promise with the token‘s claims.
108108
* Rejects the promise if the token cannot be verified.
109109
* If `checkRevoked` is set to true, first verifies whether the corresponding
110110
* user is disabled.
111-
* If yes, an auth/user-disabled error is thrown.
111+
* If yes, an `auth/user-disabled` error is thrown.
112112
* If no, verifies if the session corresponding to the ID token was revoked.
113113
* If the corresponding user's session was invalidated, an
114-
* auth/id-token-revoked error is thrown.
114+
* `auth/id-token-revoked` error is thrown.
115115
* If not specified the check is not applied.
116116
*
117117
* @param {string} idToken The JWT to verify.
@@ -510,15 +510,15 @@ export class BaseAuth<T extends AbstractAuthRequestHandler> implements BaseAuthI
510510
}
511511

512512
/**
513-
* Verifies a Firebase session cookie. Returns a promise with the tokens claims.
513+
* Verifies a Firebase session cookie. Returns a promise with the token’s claims.
514514
* Rejects the promise if the cookie could not be verified.
515515
* If `checkRevoked` is set to true, first verifies whether the corresponding
516516
* user is disabled:
517-
* If yes, an auth/user-disabled error is thrown.
517+
* If yes, an `auth/user-disabled` error is thrown.
518518
* If no, verifies if the session corresponding to the session cookie was
519519
* revoked.
520520
* If the corresponding user's session was invalidated, an
521-
* auth/session-cookie-revoked error is thrown.
521+
* `auth/session-cookie-revoked` error is thrown.
522522
* If not specified the check is not performed.
523523
*
524524
* @param {string} sessionCookie The session cookie to verify.
@@ -797,7 +797,7 @@ export class TenantAwareAuth
797797
* Verifies a JWT auth token. Returns a promise with the tokens claims. Rejects
798798
* the promise if the token could not be verified. If checkRevoked is set to true,
799799
* verifies if the session corresponding to the ID token was revoked. If the corresponding
800-
* user's session was invalidated, an auth/id-token-revoked error is thrown. If not specified
800+
* user's session was invalidated, an `auth/id-token-revoked` error is thrown. If not specified
801801
* the check is not applied.
802802
*
803803
* @param {string} idToken The JWT to verify.
@@ -848,7 +848,7 @@ export class TenantAwareAuth
848848
* Verifies a Firebase session cookie. Returns a promise with the tokens claims. Rejects
849849
* the promise if the token could not be verified. If checkRevoked is set to true,
850850
* verifies if the session corresponding to the session cookie was revoked. If the corresponding
851-
* user's session was invalidated, an auth/session-cookie-revoked error is thrown. If not
851+
* user's session was invalidated, an `auth/session-cookie-revoked` error is thrown. If not
852852
* specified the check is not performed.
853853
*
854854
* @param {string} sessionCookie The session cookie to verify.

src/auth/index.ts

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,11 +1707,15 @@ export namespace auth {
17071707
updateUser(uid: string, properties: UpdateRequest): Promise<UserRecord>;
17081708

17091709
/**
1710-
* Verifies a Firebase ID token (JWT). If the token is valid, the promise is
1711-
* fulfilled with the token's decoded claims; otherwise, the promise is
1712-
* rejected.
1713-
* An optional flag can be passed to additionally check whether the ID token
1714-
* was revoked.
1710+
* Verifies a JWT auth token. Returns a promise with the token‘s claims.
1711+
* Rejects the promise if the token cannot be verified.
1712+
* If `checkRevoked` is set to true, first verifies whether the corresponding
1713+
* user is disabled.
1714+
* If yes, an `auth/user-disabled` error is thrown.
1715+
* If no, verifies if the session corresponding to the ID token was revoked.
1716+
* If the corresponding user's session was invalidated, an
1717+
* `auth/id-token-revoked` error is thrown.
1718+
* If not specified the check is not applied.
17151719
*
17161720
* See [Verify ID Tokens](/docs/auth/admin/verify-id-tokens) for code samples
17171721
* and detailed documentation.
@@ -1821,18 +1825,22 @@ export namespace auth {
18211825
): Promise<string>;
18221826

18231827
/**
1824-
* Verifies a Firebase session cookie. Returns a Promise with the cookie claims.
1825-
* Rejects the promise if the cookie could not be verified. If `checkRevoked` is
1826-
* set to true, verifies if the session corresponding to the session cookie was
1827-
* revoked. If the corresponding user's session was revoked, an
1828-
* `auth/session-cookie-revoked` error is thrown. If not specified the check is
1829-
* not performed.
1828+
* Verifies a Firebase session cookie. Returns a promise with the token’s claims.
1829+
* Rejects the promise if the cookie could not be verified.
1830+
* If `checkRevoked` is set to true, first verifies whether the corresponding
1831+
* user is disabled:
1832+
* If yes, an `auth/user-disabled` error is thrown.
1833+
* If no, verifies if the session corresponding to the session cookie was
1834+
* revoked.
1835+
* If the corresponding user's session was invalidated, an
1836+
* `auth/session-cookie-revoked` error is thrown.
1837+
* If not specified the check is not performed.
18301838
*
18311839
* See [Verify Session Cookies](/docs/auth/admin/manage-cookies#verify_session_cookie_and_check_permissions)
18321840
* for code samples and detailed documentation
18331841
*
18341842
* @param sessionCookie The session cookie to verify.
1835-
* @param checkForRevocation Whether to check if the session cookie was
1843+
* @param checkRevoked Whether to check if the session cookie was
18361844
* revoked. This requires an extra request to the Firebase Auth backend to
18371845
* check the `tokensValidAfterTime` time for the corresponding user.
18381846
* When not specified, this additional check is not performed.
@@ -1843,7 +1851,7 @@ export namespace auth {
18431851
*/
18441852
verifySessionCookie(
18451853
sessionCookie: string,
1846-
checkForRevocation?: boolean,
1854+
checkRevoked?: boolean,
18471855
): Promise<DecodedIdToken>;
18481856

18491857
/**

0 commit comments

Comments
 (0)