Added "forgot password?" back
This commit is contained in:
@@ -85,6 +85,17 @@ const auth_info = Dict(
|
||||
)
|
||||
)
|
||||
|
||||
const reset_password_info = Dict(
|
||||
"en" => Dict(
|
||||
:title => "LibSoc - Reset password",
|
||||
:description => ""
|
||||
),
|
||||
"ru" => Dict(
|
||||
:title => "LibSoc - Восстановление пароля",
|
||||
:description => ""
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
#---Routing functions---------------------------------------------------
|
||||
|
||||
@@ -93,6 +104,7 @@ const dict_layouts = Dict(
|
||||
:auth => generate_layout_html("main",controller,"auth",libraries=["GoogleAuth"]),
|
||||
:profile => generate_layout_html("main",controller,"profile",libraries=["Leaflet"]),
|
||||
:email_confirmation => generate_layout_html("main",controller,"email_confirmation"),
|
||||
:reset_password => generate_layout_html("main",controller,"reset_password")
|
||||
)
|
||||
|
||||
function auth()
|
||||
@@ -120,6 +132,15 @@ function email_confirmation()
|
||||
)
|
||||
end
|
||||
|
||||
function reset_password()
|
||||
locale = get_locale()
|
||||
set_cookies(params())
|
||||
html(:authentication,:reset_password, layout = dict_layouts[:reset_password], context = @__MODULE__,
|
||||
title = reset_password_info[locale][:title],
|
||||
description = reset_password_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function confirm_email()
|
||||
code = rawpayload()
|
||||
user = current_user()
|
||||
|
@@ -0,0 +1,2 @@
|
||||
<reset-password-component></reset-password-component>
|
||||
|
@@ -10,7 +10,6 @@ import watch from "rollup-plugin-watch";
|
||||
|
||||
const production = !process.env.ROLLUP_WATCH;
|
||||
|
||||
|
||||
function serve() {
|
||||
let server;
|
||||
|
||||
|
@@ -25,6 +25,7 @@
|
||||
let googleButton
|
||||
|
||||
let parentProps = getContext("auth")
|
||||
let locale = "en"
|
||||
|
||||
function renderGoogle() {
|
||||
if (parentProps.googleInit) {
|
||||
@@ -80,7 +81,7 @@
|
||||
<input bind:this={rememberMe} type="checkbox" id="remember-me-checkbox"><label id="remember-me-label" for="passwordInput">remember me</label>
|
||||
</div>
|
||||
<button class="auth-button" on:click="{() => AuthTools.login(msgs,inputs)}">Log in</button>
|
||||
<a id="forgot-password" href="forgot-password"></a>
|
||||
<a id="forgot-password" href={"/"+locale+"/reset-password"}>Forgot password?</a>
|
||||
<!--
|
||||
<hr class="auth-line">
|
||||
<div class="auth-methods-group">
|
||||
|
47
Server/app/svelte/src/auth/reset-password-component.svelte
Normal file
47
Server/app/svelte/src/auth/reset-password-component.svelte
Normal file
@@ -0,0 +1,47 @@
|
||||
<svelte:options tag="reset-password-component" />
|
||||
|
||||
<script>
|
||||
|
||||
// Import statements
|
||||
import { onMount } from 'svelte'
|
||||
|
||||
// Export statements
|
||||
|
||||
|
||||
// Main code
|
||||
|
||||
onMount(() => {
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<div id="container">
|
||||
<div id="text-container">
|
||||
<p>Contact us at our Discord Server. We are going to send a new password to the email that you used for registration.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
@import '/css/common.css';
|
||||
|
||||
#text-container {
|
||||
position: relative;
|
||||
max-width: calc(100vw - 4rem);
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
#container {
|
||||
margin: auto;
|
||||
max-width: 800px;
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 4rem;
|
||||
}
|
||||
|
||||
#container p {
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
</style>
|
@@ -15,7 +15,7 @@
|
||||
let mapContainer
|
||||
|
||||
function createMap(center,zoom) {
|
||||
let map = L.map(mapContainer, {
|
||||
map = L.map(mapContainer, {
|
||||
center: center,
|
||||
zoom: zoom,
|
||||
});
|
||||
|
Reference in New Issue
Block a user