headers: defaultHeaders()

in src/server/lib/okta/api/authentication.ts [55:84]


		headers: defaultHeaders(ip),
	}).then(handleAuthenticationResponse);
};

/**
 * @name validateRecoveryToken
 * @description Validates a recovery token that was distributed to the end user
 *
 * https://developer.okta.com/docs/reference/api/authn/#verify-recovery-token
 *
 * This is used to continue a recovery transaction (such as
 * resetting a password or completing account activation).
 *
 * If valid, a state token is returned which can be used to complete the recovery transaction.
 * This is a short-lived token with an expiry time of 5 minutes 30 seconds.
 *
 * @param {string} body.recoveryToken Recovery token that was distributed to the end user via out-of-band mechanism such as email
 *
 * @returns Promise<AuthenticationTransaction>
 */
export const validateRecoveryToken = async ({
	recoveryToken,
	ip,
}: {
	recoveryToken: string;
	ip?: string;
}): Promise<AuthenticationTransaction> => {
	const path = buildUrl('/api/v1/authn/recovery/token');

	const body = {