mirror of
https://github.com/pockethost/pockethost.git
synced 2025-05-11 18:29:54 +00:00
remove unused signup screen
This commit is contained in:
parent
59cf4e4956
commit
6e9ad0c4a7
@ -1,94 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { slide } from 'svelte/transition'
|
||||
import { client } from '$src/pocketbase-client'
|
||||
|
||||
const { createUser, authViaEmail } = client()
|
||||
|
||||
let email: string = ''
|
||||
let password: string = ''
|
||||
let formError: string = ''
|
||||
|
||||
let isFormButtonDisabled: boolean = true
|
||||
$: isFormButtonDisabled = email.length === 0 || password.length === 0
|
||||
|
||||
const handleSubmit = async (e: Event) => {
|
||||
e.preventDefault()
|
||||
|
||||
isFormButtonDisabled = true
|
||||
formError = ''
|
||||
|
||||
try {
|
||||
// Create the new user and email the verification link
|
||||
await createUser(email, password)
|
||||
|
||||
// Go ahead and log the user into the site
|
||||
await authViaEmail(email, password)
|
||||
} catch (error) {
|
||||
const e = error as Error
|
||||
formError = `Something went wrong with registering your account. ${e.message}`
|
||||
}
|
||||
|
||||
isFormButtonDisabled = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Sign Up - PocketHost</title>
|
||||
</svelte:head>
|
||||
|
||||
<div class="flex justify-center">
|
||||
<div class="card w-96 bg-base-100 shadow-xl">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title mb-4">Sign Up</h2>
|
||||
|
||||
<form on:submit={handleSubmit}>
|
||||
<div class="form-control w-full max-w-xs">
|
||||
<label class="label" for="email">Email address</label>
|
||||
<input
|
||||
type="email"
|
||||
class="input input-bordered w-full max-w-xs"
|
||||
id="email"
|
||||
placeholder="name@example.com"
|
||||
bind:value={email}
|
||||
required
|
||||
autocomplete="email"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-control w-full max-w-xs">
|
||||
<label class="label" for="password">Password</label>
|
||||
<input
|
||||
type="password"
|
||||
class="input input-bordered w-full max-w-xs"
|
||||
id="password"
|
||||
placeholder="Password"
|
||||
bind:value={password}
|
||||
required
|
||||
autocomplete="current-password"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{#if formError}
|
||||
<div transition:slide class="alert alert-error mb-5">
|
||||
<i class="fa-solid fa-circle-exclamation"></i>
|
||||
<span>{formError}</span>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="m-3 btn btn-primary w-100"
|
||||
disabled={isFormButtonDisabled}
|
||||
>
|
||||
Sign Up <i class="bi bi-arrow-right-short" />
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="py-4"><hr /></div>
|
||||
|
||||
<div class="text-center">
|
||||
<a class="link" href="/login">log in</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user