Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/fxa-auth-client/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,21 @@ export default class AuthClient {
}

extraHeaders.set('Content-Type', 'application/json');

// Only include credentials for specific endpoints that may trigger WAF challenges
const includeCredentials = [
'/account/create',
'/password/forgot/send_otp',
].some((endpoint) => path.includes(endpoint));

try {
const response = await fetchOrTimeout(
this.url(path),
{
method,
headers: extraHeaders,
body: cleanStringify(payload),
credentials: includeCredentials ? 'include' : 'same-origin',
},
this.timeout
);
Expand Down
1 change: 1 addition & 0 deletions packages/fxa-auth-server/lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ async function create(log, error, config, routes, db, statsd, glean, customs) {
// If we're accepting CORS from any origin then use Hapi's "ignore" mode,
// which is more forgiving of missing Origin header.
origin: config.corsOrigin[0] === '*' ? 'ignore' : config.corsOrigin,
credentials: true,
},
security: {
hsts: {
Expand Down
Loading