chore: hide login fields if logged in user matches invite email
This commit is contained in:
@@ -179,7 +179,7 @@
|
|||||||
|
|
||||||
$: isLoading = loading || $user.fetchingUser;
|
$: isLoading = loading || $user.fetchingUser;
|
||||||
$: console.log('$profile', $profile);
|
$: console.log('$profile', $profile);
|
||||||
$: console.log('data.invite.profile', data.invite.profile);
|
$: console.log('data.invite', data.invite);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
@@ -212,21 +212,21 @@
|
|||||||
inputClassName="w-full"
|
inputClassName="w-full"
|
||||||
isDisabled={true}
|
isDisabled={true}
|
||||||
/>
|
/>
|
||||||
{#if !data.invite.profile}
|
|
||||||
<TextField
|
|
||||||
label={$t('login.fields.full_name')}
|
|
||||||
bind:value={fields.name}
|
|
||||||
type="text"
|
|
||||||
autoFocus={true}
|
|
||||||
placeholder="e.g Joke Silva"
|
|
||||||
className="mb-6"
|
|
||||||
inputClassName="w-full"
|
|
||||||
isDisabled={loading}
|
|
||||||
errorMessage={errors.name}
|
|
||||||
isRequired
|
|
||||||
/>
|
|
||||||
{/if}
|
|
||||||
{#if $profile?.email !== data.invite.email}
|
{#if $profile?.email !== data.invite.email}
|
||||||
|
{#if !data.invite.profile}
|
||||||
|
<TextField
|
||||||
|
label={$t('login.fields.full_name')}
|
||||||
|
bind:value={fields.name}
|
||||||
|
type="text"
|
||||||
|
autoFocus={true}
|
||||||
|
placeholder="e.g Joke Silva"
|
||||||
|
className="mb-6"
|
||||||
|
inputClassName="w-full"
|
||||||
|
isDisabled={loading}
|
||||||
|
errorMessage={errors.name}
|
||||||
|
isRequired
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
<TextField
|
<TextField
|
||||||
label={$t('login.fields.password')}
|
label={$t('login.fields.password')}
|
||||||
bind:value={fields.password}
|
bind:value={fields.password}
|
||||||
@@ -239,19 +239,19 @@
|
|||||||
helperMessage={$t('login.fields.password_helper_message')}
|
helperMessage={$t('login.fields.password_helper_message')}
|
||||||
isRequired
|
isRequired
|
||||||
/>
|
/>
|
||||||
{/if}
|
{#if !data.invite.profile}
|
||||||
{#if !data.invite.profile}
|
<TextField
|
||||||
<TextField
|
label={$t('login.fields.confirm_password')}
|
||||||
label={$t('login.fields.confirm_password')}
|
bind:value={fields.confirmPassword}
|
||||||
bind:value={fields.confirmPassword}
|
type="password"
|
||||||
type="password"
|
placeholder="************"
|
||||||
placeholder="************"
|
className="mb-6"
|
||||||
className="mb-6"
|
inputClassName="w-full"
|
||||||
inputClassName="w-full"
|
isDisabled={loading}
|
||||||
isDisabled={loading}
|
errorMessage={errors.confirmPassword}
|
||||||
errorMessage={errors.confirmPassword}
|
isRequired
|
||||||
isRequired
|
/>
|
||||||
/>
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{#if submitError}
|
{#if submitError}
|
||||||
<p class="text-sm text-red-500">{submitError}</p>
|
<p class="text-sm text-red-500">{submitError}</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user