Skip to content

Commit ba14577

Browse files
committed
PR Feedback
1 parent f3d4786 commit ba14577

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

packages-exp/auth-exp/src/model/action_code_url.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ enum QueryField {
3535
/**
3636
* Map from mode string in action code URL to Action Code Info operation.
3737
*/
38-
const _ModeToOperationMap: { [key: string]: Operation } = {
38+
const ModeToOperationMap: { [key: string]: Operation } = {
3939
'recoverEmail': Operation.RECOVER_EMAIL,
4040
'resetPassword': Operation.PASSWORD_RESET,
4141
'signIn': Operation.EMAIL_SIGNIN,
@@ -47,11 +47,11 @@ const _ModeToOperationMap: { [key: string]: Operation } = {
4747
/**
4848
* Maps the mode string in action code URL to Action Code Info operation.
4949
*/
50-
function _parseMode(mode: string | null): Operation | null {
51-
return mode ? _ModeToOperationMap[mode] || null : null;
50+
function parseMode(mode: string | null): Operation | null {
51+
return mode ? ModeToOperationMap[mode] || null : null;
5252
}
5353

54-
function _parseDeepLink(url: string): string {
54+
function parseDeepLink(url: string): string {
5555
const uri = new URL(url);
5656
const link = uri.searchParams.get('link');
5757
// Double link case (automatic redirect).
@@ -76,7 +76,7 @@ export class ActionCodeURL {
7676
const uri = new URL(actionLink);
7777
const apiKey = uri.searchParams.get(QueryField.API_KEY);
7878
const code = uri.searchParams.get(QueryField.CODE);
79-
const operation = _parseMode(uri.searchParams.get(QueryField.MODE));
79+
const operation = parseMode(uri.searchParams.get(QueryField.MODE));
8080
// Validate API key, code and mode.
8181
if (!apiKey || !code || !operation) {
8282
throw AUTH_ERROR_FACTORY.create(AuthErrorCode.ARGUMENT_ERROR, {
@@ -89,14 +89,13 @@ export class ActionCodeURL {
8989
this.continueUrl = uri.searchParams.get(QueryField.CONTINUE_URL);
9090
this.languageCode = uri.searchParams.get(QueryField.LANGUAGE_CODE);
9191
this.tenantId = uri.searchParams.get(QueryField.TENANT_ID);
92-
return this;
9392
}
9493

9594
static _fromLink(auth: Auth, link: string): ActionCodeURL | null {
96-
const actionLink = _parseDeepLink(link);
95+
const actionLink = parseDeepLink(link);
9796
try {
9897
return new ActionCodeURL(auth, actionLink);
99-
} catch (e) {
98+
} catch {
10099
return null;
101100
}
102101
}

0 commit comments

Comments
 (0)