removed blade and htmx
This commit is contained in:
@@ -1,54 +1,68 @@
|
||||
<script>
|
||||
import {getContext} from "svelte";
|
||||
import SpinnerButton from "../common/SpinnerButton.svelte";
|
||||
import { getContext } from "svelte";
|
||||
import { apiPost } from "../../helpers";
|
||||
|
||||
const channel = getContext("channel");
|
||||
let email = "";
|
||||
let message = "";
|
||||
let submitted = false;
|
||||
|
||||
function login(e) {
|
||||
e.preventDefault();
|
||||
|
||||
axios
|
||||
.post(channel.lucentUrl + "/login", {
|
||||
email: email,
|
||||
apiPost(channel.lucentUrl + "/login", { email: email })
|
||||
.then(() => {
|
||||
submitted = true;
|
||||
})
|
||||
.then((response) => {
|
||||
console.log(response)
|
||||
message = "You will receive an email with a login link"
|
||||
})
|
||||
.catch((error) => {
|
||||
});
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="wrapper-tiny">
|
||||
{#if message}
|
||||
<div class="alert alert-info" role="alert">
|
||||
{message}
|
||||
</div>
|
||||
|
||||
{:else}
|
||||
|
||||
<form on:submit={login}>
|
||||
<div class="mb-3">
|
||||
<label for="emailaddress" class="form-label">Email address</label>
|
||||
<input
|
||||
type="email"
|
||||
bind:value={email}
|
||||
class="form-control"
|
||||
id="emailaddress"
|
||||
required
|
||||
/>
|
||||
<div class="scope-login">
|
||||
<div class="bg-image"></div>
|
||||
<div class="login-form">
|
||||
{#if submitted}
|
||||
<div class="alert alert-info" role="alert">
|
||||
<p>
|
||||
You will receive an email with a login link at <b>{email}</b
|
||||
>.
|
||||
</p>
|
||||
<p>Check your spam folder</p>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="form">
|
||||
<h2 class="mb-5">Enter Lucent</h2>
|
||||
|
||||
<form on:submit={login}>
|
||||
<p>
|
||||
Submit your email address and you will receive a <b
|
||||
>login link</b
|
||||
> to your email
|
||||
</p>
|
||||
<p>Don't forget to check your spam folder</p>
|
||||
<div class="mt-5 mb-3">
|
||||
<label for="emailaddress" class="form-label"
|
||||
>Email address</label
|
||||
>
|
||||
<input
|
||||
type="email"
|
||||
bind:value={email}
|
||||
class="form-control"
|
||||
id="emailaddress"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="text-center mt-5 d-block">
|
||||
<SpinnerButton label="Login"/>
|
||||
<button class="bt bt-primary">
|
||||
Send email
|
||||
<img
|
||||
alt="indicator"
|
||||
id="indicator"
|
||||
class="htmx-indicator"
|
||||
src="/img/spinner.svg"
|
||||
/>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user