refacto(*): remove everything about default workspace (#9157)
## Summary - [x] Remove defaultWorkspace in user - [x] Remove all occurrence of defaultWorkspace and defaultWorkspaceId - [x] Improve activate workspace flow - [x] Improve security on social login - [x] Add `ImpersonateGuard` - [x] Allow to use impersonation with couple `User/Workspace` - [x] Prevent unexpected reload on activate workspace - [x] Scope login token with workspaceId Fix https://github.com/twentyhq/twenty/issues/9033#event-15714863042
This commit is contained in:
@ -1,33 +0,0 @@
|
||||
import { isDefined } from 'src/utils/is-defined';
|
||||
|
||||
export const buildWorkspaceURL = (
|
||||
baseUrl: string,
|
||||
subdomain: string | null,
|
||||
{
|
||||
withPathname,
|
||||
withSearchParams,
|
||||
}: {
|
||||
withPathname?: string;
|
||||
withSearchParams?: Record<string, string | number>;
|
||||
} = {},
|
||||
) => {
|
||||
const url = new URL(baseUrl);
|
||||
|
||||
if (subdomain && subdomain.length > 0) {
|
||||
url.hostname = subdomain + '.' + url.hostname;
|
||||
}
|
||||
|
||||
if (withPathname) {
|
||||
url.pathname = withPathname;
|
||||
}
|
||||
|
||||
if (withSearchParams) {
|
||||
Object.entries(withSearchParams).forEach(([key, value]) => {
|
||||
if (isDefined(value)) {
|
||||
url.searchParams.set(key, value.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return url;
|
||||
};
|
||||
Reference in New Issue
Block a user