Skip to content

Commit 5a9fe26

Browse files
committed
feat(): include credentials for passwordless enpoints to allow WAF rules
1 parent ccbffde commit 5a9fe26

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

packages/fxa-auth-client/lib/client.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ export default class AuthClient {
308308
const includeCredentials = [
309309
'/account/create',
310310
'/password/forgot/send_otp',
311+
'/account/passwordless/send_code',
312+
'/account/passwordless/confirm_code',
313+
'/account/passwordless/resend_code',
311314
].some((endpoint) => path.startsWith(endpoint));
312315

313316
if (includeCredentials && new URL(this.uri).protocol === 'https:') {
@@ -1231,7 +1234,11 @@ export default class AuthClient {
12311234
*/
12321235
async passwordlessSendCode(
12331236
email: string,
1234-
options: { clientId?: string; service?: string; metricsContext?: MetricsContext } = {},
1237+
options: {
1238+
clientId?: string;
1239+
service?: string;
1240+
metricsContext?: MetricsContext;
1241+
} = {},
12351242
headers?: Headers
12361243
): Promise<{}> {
12371244
return this.request(
@@ -1248,7 +1255,11 @@ export default class AuthClient {
12481255
async passwordlessConfirmCode(
12491256
email: string,
12501257
code: string,
1251-
options: { clientId?: string; service?: string; metricsContext?: MetricsContext } = {},
1258+
options: {
1259+
clientId?: string;
1260+
service?: string;
1261+
metricsContext?: MetricsContext;
1262+
} = {},
12521263
headers?: Headers
12531264
): Promise<{
12541265
uid: string;
@@ -1272,7 +1283,11 @@ export default class AuthClient {
12721283
*/
12731284
async passwordlessResendCode(
12741285
email: string,
1275-
options: { clientId?: string; service?: string; metricsContext?: MetricsContext } = {},
1286+
options: {
1287+
clientId?: string;
1288+
service?: string;
1289+
metricsContext?: MetricsContext;
1290+
} = {},
12761291
headers?: Headers
12771292
): Promise<{}> {
12781293
return this.request(
@@ -3444,4 +3459,4 @@ export default class AuthClient {
34443459
throw error;
34453460
}
34463461
}
3447-
}
3462+
}

0 commit comments

Comments
 (0)