mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 01:01:49 +10:00
18 lines
437 B
TypeScript
18 lines
437 B
TypeScript
import { WEBAPP_BASE_URL } from '../constants/app';
|
|
import { PASSKEY_TIMEOUT } from '../constants/auth';
|
|
|
|
/**
|
|
* Extracts common fields to identify the RP (relying party)
|
|
*/
|
|
export const getAuthenticatorRegistrationOptions = () => {
|
|
const webAppBaseUrl = new URL(WEBAPP_BASE_URL);
|
|
const rpId = webAppBaseUrl.hostname;
|
|
|
|
return {
|
|
rpName: 'Documenso',
|
|
rpId,
|
|
origin: WEBAPP_BASE_URL,
|
|
timeout: PASSKEY_TIMEOUT,
|
|
};
|
|
};
|