Skip to content

Commit

Permalink
Fix guest profile to not try and load credential
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenWeathers committed Sep 19, 2024
1 parent 678acfa commit 9570a80
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 29 deletions.
54 changes: 29 additions & 25 deletions ui/src/components/user/ProfileForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -157,25 +157,27 @@
for="yourEmail"
>
{$LL.email()}
{#if profile.verified}
<span
class="inline-block font-bold text-green-600
{#if profile.rank && profile.rank !== 'GUEST'}
{#if profile.verified}
<span
class="inline-block font-bold text-green-600
border-green-500 border py-1 px-2 rounded
ms-1"
data-testid="user-verified"
>
{$LL.verified()}
<BadgeCheck class="inline h-4 w-4" />
</span>
{:else if profile.rank !== 'GUEST'}
<button
class="float-right inline-block align-baseline font-bold text-sm text-blue-500
data-testid="user-verified"
>
{$LL.verified()}
<BadgeCheck class="inline h-4 w-4" />
</span>
{:else}
<button
class="float-right inline-block align-baseline font-bold text-sm text-blue-500
hover:text-blue-800"
on:click="{requestVerifyEmail}"
data-testid="request-verify"
type="button"
>{$LL.requestVerifyEmail()}
</button>
on:click="{requestVerifyEmail}"
data-testid="request-verify"
type="button"
>{$LL.requestVerifyEmail()}
</button>
{/if}
{/if}
</label>
<TextInput
Expand Down Expand Up @@ -334,16 +336,18 @@

<div>
<div class="text-right">
{#if !ldapEnabled && !headerAuthEnabled && profile.rank !== 'GUEST' && toggleUpdatePassword}
<button
type="button"
class="inline-block align-baseline font-bold
{#if profile.rank && profile.rank !== 'GUEST'}
{#if !ldapEnabled && !headerAuthEnabled && toggleUpdatePassword}
<button
type="button"
class="inline-block align-baseline font-bold
text-sm text-blue-500 hover:text-blue-800 me-4"
on:click="{toggleUpdatePassword}"
data-testid="toggle-updatepassword"
>
{$LL.updatePassword()}
</button>
on:click="{toggleUpdatePassword}"
data-testid="toggle-updatepassword"
>
{$LL.updatePassword()}
</button>
{/if}
{/if}
<SolidButton type="submit" disabled="{updateDisabled}">
{$LL.updateProfile()}
Expand Down
13 changes: 9 additions & 4 deletions ui/src/pages/user/UserProfile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
export let eventTag;
let userProfile = {};
let userCredential = {};
let userCredential = null;
let apiKeys = [];
let jiraInstances = [];
let showApiKeyCreate = false;
Expand Down Expand Up @@ -280,10 +280,15 @@
}
getProfile();
getCredential();
if (ExternalAPIEnabled) {
getApiKeys();
if ($user.rank !== 'GUEST') {
getCredential();
if (ExternalAPIEnabled) {
getApiKeys();
}
}
if (
(SubscriptionsEnabled && $user.subscribed) ||
(!SubscriptionsEnabled && $user.rank !== 'GUEST')
Expand Down

0 comments on commit 9570a80

Please sign in to comment.