Compare commits

...

3 Commits

Author SHA1 Message Date
c6bca6a602 fix deprecated kysely usage 2025-05-09 16:44:33 +01:00
55d1a2c932 Fix typo in enforce-sso.tsx (#1145) 2025-05-09 11:11:02 +01:00
bc3cb2d63f fix: increase random subdomain suffix 2025-05-07 15:10:58 +01:00
4 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ export default function EnforceSso() {
<Text size="md">{t("Enforce SSO")}</Text> <Text size="md">{t("Enforce SSO")}</Text>
<Text size="sm" c="dimmed"> <Text size="sm" c="dimmed">
{t( {t(
"Once enforced, members will not able to login with email and password.", "Once enforced, members will not be able to login with email and password.",
)} )}
</Text> </Text>
</div> </div>

View File

@ -387,14 +387,14 @@ export class WorkspaceService {
.replace(/[^a-z0-9]/g, '') .replace(/[^a-z0-9]/g, '')
.substring(0, 20); .substring(0, 20);
// Ensure we leave room for a random suffix. // Ensure we leave room for a random suffix.
const maxSuffixLength = 3; const maxSuffixLength = 6;
if (subdomain.length < 4) { if (subdomain.length < 4) {
subdomain = `${subdomain}-${generateRandomSuffix(maxSuffixLength)}`; subdomain = `${subdomain}-${generateRandomSuffix(maxSuffixLength)}`;
} }
if (DISALLOWED_HOSTNAMES.includes(subdomain)) { if (DISALLOWED_HOSTNAMES.includes(subdomain)) {
subdomain = `myworkspace-${generateRandomSuffix(maxSuffixLength)}`; subdomain = `workspace-${generateRandomSuffix(maxSuffixLength)}`;
} }
let uniqueHostname = subdomain; let uniqueHostname = subdomain;

View File

@ -70,7 +70,7 @@ export class UserTokenRepo {
.where('userId', '=', userId) .where('userId', '=', userId)
.where('workspaceId', '=', workspaceId) .where('workspaceId', '=', workspaceId)
.where('type', '=', tokenType) .where('type', '=', tokenType)
.orderBy('expiresAt desc') .orderBy('expiresAt', 'desc')
.execute(); .execute();
} }

View File

@ -70,7 +70,7 @@ export class WorkspaceRepo {
return await this.db return await this.db
.selectFrom('workspaces') .selectFrom('workspaces')
.selectAll() .selectAll()
.orderBy('createdAt asc') .orderBy('createdAt', 'asc')
.limit(1) .limit(1)
.executeTakeFirst(); .executeTakeFirst();
} }