# Content - Introduce the `workspaceUrls` property. It contains two sub-properties: `customUrl, subdomainUrl`. These endpoints are used to access the workspace. Even if the `workspaceUrls` is invalid for multiple reasons, the `subdomainUrl` remains valid. - Introduce `ResolveField` workspaceEndpoints to avoid unnecessary URL computation on the frontend part. - Add a `forceSubdomainUrl` to avoid custom URL using a query parameter
22 lines
716 B
TypeScript
22 lines
716 B
TypeScript
import { createState } from '@ui/utilities/state/utils/createState';
|
|
import { cookieStorageEffect } from '~/utils/recoil-effects';
|
|
|
|
export const lastAuthenticatedWorkspaceDomainState = createState<
|
|
| {
|
|
workspaceUrl: string;
|
|
workspaceId: string;
|
|
cookieAttributes?: Cookies.CookieAttributes;
|
|
}
|
|
| null
|
|
// this type is necessary to let the deletion of cookie. Without the domain the cookie is not deleted.
|
|
| { cookieAttributes?: Cookies.CookieAttributes }
|
|
>({
|
|
key: 'lastAuthenticateWorkspaceDomain',
|
|
defaultValue: null,
|
|
effects: [
|
|
cookieStorageEffect('lastAuthenticateWorkspaceDomain', {
|
|
expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year
|
|
}),
|
|
],
|
|
});
|