Skip to content

Commit 56369c0

Browse files
committed
renamed Env to EmulatorEnv
1 parent aac88c6 commit 56369c0

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

example/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Auth, emulatorHost, Env, WorkersKVStoreSingle } from "../src";
1+
import { Auth, emulatorHost, EmulatorEnv, WorkersKVStoreSingle } from "../src";
22

3-
interface Bindings extends Env {
3+
interface Bindings extends EmulatorEnv {
44
EMAIL_ADDRESS: string
55
PASSWORD: string
66
FIREBASE_AUTH_EMULATOR_HOST: string

src/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Env, useEmulator } from "./emulator";
1+
import { EmulatorEnv, useEmulator } from "./emulator";
22
import { KeyStorer } from "./key-store";
33
import {
44
createIdTokenVerifier,
@@ -32,7 +32,7 @@ export class BaseAuth {
3232
* token's decoded claims if the ID token is valid; otherwise, a rejected
3333
* promise.
3434
*/
35-
public verifyIdToken(idToken: string, env?: Env): Promise<FirebaseIdToken> {
35+
public verifyIdToken(idToken: string, env?: EmulatorEnv): Promise<FirebaseIdToken> {
3636
const isEmulator = useEmulator(env);
3737
return this.idTokenVerifier.verifyJWT(idToken, isEmulator);
3838
}

src/emulator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
export interface Env {
1+
export interface EmulatorEnv {
22
FIREBASE_AUTH_EMULATOR_HOST: string | undefined
33
}
44

5-
export function emulatorHost(env?: Env): string | undefined {
5+
export function emulatorHost(env?: EmulatorEnv): string | undefined {
66
return env?.FIREBASE_AUTH_EMULATOR_HOST;
77
}
88

99
/**
1010
* When true the SDK should communicate with the Auth Emulator for all API
1111
* calls and also produce unsigned tokens.
1212
*/
13-
export const useEmulator = (env?: Env): boolean => {
13+
export const useEmulator = (env?: EmulatorEnv): boolean => {
1414
return !!emulatorHost(env);
1515
};

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export {
66
useEmulator
77
} from "./emulator"
88
export type { KeyStorer }
9-
export type { Env } from './emulator'
9+
export type { EmulatorEnv } from './emulator'
10+
export type { FirebaseIdToken } from './token-verifier'
1011

1112
export class Auth extends BaseAuth {
1213
private static instance?: Auth;

0 commit comments

Comments
 (0)