0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00
logto/packages/integration-tests/src/constants.ts

48 lines
1.6 KiB
TypeScript
Raw Normal View History

import { type CreateSsoConnector, SignInIdentifier, demoAppApplicationId } from '@logto/schemas';
import { appendPath, getEnv } from '@silverhand/essentials';
export const logtoUrl = getEnv('INTEGRATION_TESTS_LOGTO_URL', 'http://localhost:3001');
export const logtoConsoleUrl = getEnv(
'INTEGRATION_TESTS_LOGTO_CONSOLE_URL',
'http://localhost:3002'
);
2023-03-05 09:07:02 -05:00
export const logtoCloudUrl = getEnv('INTEGRATION_TESTS_LOGTO_CLOUD_URL', 'http://localhost:3003');
export const demoAppUrl = appendPath(new URL(logtoUrl), 'demo-app');
export const discoveryUrl = `${logtoUrl}/oidc/.well-known/openid-configuration`;
export const demoAppRedirectUri = `${logtoUrl}/${demoAppApplicationId}`;
export const adminConsoleRedirectUri = `${logtoConsoleUrl}/console/callback`;
export const signUpIdentifiers = {
username: [SignInIdentifier.Username],
email: [SignInIdentifier.Email],
sms: [SignInIdentifier.Phone],
emailOrSms: [SignInIdentifier.Email, SignInIdentifier.Phone],
none: [],
};
2023-10-26 05:03:16 -05:00
export const consoleUsername = 'svhd';
export const consolePassword = 'silverhandasd_1';
export const mockSocialAuthPageUrl = 'http://mock.social.com';
// @see {@link packages/core/src/sso/types}
export enum ProviderName {
OIDC = 'OIDC',
}
export const newOidcSsoConnectorPayload = {
providerName: ProviderName.OIDC,
connectorName: 'test-oidc',
domains: ['example.io'], // Auto-generated email domain
branding: {
logo: 'https://logto.io/oidc-logo.png',
darkLogo: 'https://logto.io/oidc-dark-logo.png',
},
config: {
clientId: 'foo',
clientSecret: 'bar',
issuer: `${logtoUrl}/oidc`,
},
} satisfies Partial<CreateSsoConnector>;