mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-21 16:02:28 +00:00
fix username handling with non A_Z
This commit is contained in:
@@ -77,14 +77,17 @@
|
||||
|
||||
export async function reset() {
|
||||
if (path == '' || path == 'u//') {
|
||||
if ($lastMetaUsed == undefined) {
|
||||
if ($lastMetaUsed == undefined || $lastMetaUsed.owner != $userStore?.username) {
|
||||
meta = {
|
||||
ownerKind: 'user',
|
||||
name: random_adj() + '_' + namePlaceholder,
|
||||
owner: ''
|
||||
}
|
||||
|
||||
meta.owner = $userStore!.username.split('@')[0].replace(/[^a-zA-Z0-9]/g, '')
|
||||
if ($userStore?.username?.includes('@')) {
|
||||
meta.owner = $userStore!.username.split('@')[0].replace(/[^a-zA-Z0-9_]/g, '')
|
||||
} else {
|
||||
meta.owner = $userStore!.username!
|
||||
}
|
||||
} else {
|
||||
meta = { ...$lastMetaUsed, name: random_adj() + '_' + namePlaceholder }
|
||||
}
|
||||
|
||||
@@ -143,7 +143,6 @@
|
||||
|
||||
<svelte:window bind:innerWidth />
|
||||
<UserSettings bind:this={userSettings} />
|
||||
|
||||
{#if $page.status == 404}
|
||||
<CenteredModal title="Page not found, redirecting you to login">
|
||||
<div class="w-full">
|
||||
|
||||
Reference in New Issue
Block a user