From 12999c764e113812f6a310c164717b10caf59ba3 Mon Sep 17 00:00:00 2001 From: a-ill Date: Wed, 2 Aug 2023 00:42:25 +0300 Subject: [PATCH] Added "forgot password?" back --- .../AuthenticationController.jl | 21 +++++++++ .../views/reset_password.jl.html | 2 + Server/app/svelte/rollup.config.js | 1 - .../svelte/src/auth/login-component.svelte | 3 +- .../src/auth/reset-password-component.svelte | 47 +++++++++++++++++++ .../src/components/map-component.svelte | 2 +- Server/public/js/components/auth-component.js | 2 +- .../js/components/communes-add-component.js | 2 +- .../js/components/communes-component.js | 2 +- .../public/js/components/compass-component.js | 2 +- .../js/components/confirmation-component.js | 2 +- Server/public/js/components/cookies-dialog.js | 2 +- .../components/cooperatives-add-component.js | 2 +- .../js/components/cooperatives-component.js | 2 +- .../public/js/components/footer-component.js | 2 +- .../js/components/groups-add-component.js | 2 +- .../public/js/components/groups-component.js | 2 +- Server/public/js/components/index-4da4d0ce.js | 1 + Server/public/js/components/index-6a7bc1e2.js | 1 + .../public/js/components/join-us-component.js | 2 +- .../public/js/components/landing-component.js | 2 +- .../public/js/components/legend-component.js | 2 +- .../js/components/loadscreen-component.js | 2 +- .../public/js/components/login-component.js | 2 +- .../js/components/manifesto-component.js | 2 +- Server/public/js/components/map-component.js | 2 +- Server/public/js/components/navbar-logged.js | 2 +- .../public/js/components/navbar-not-logged.js | 2 +- Server/public/js/components/pane-aligner.js | 2 +- .../js/components/parties-add-component.js | 2 +- .../public/js/components/parties-component.js | 2 +- .../js/components/partners-add-component.js | 2 +- .../js/components/partners-component.js | 2 +- .../public/js/components/profile-communes.js | 2 +- .../public/js/components/profile-component.js | 2 +- Server/public/js/components/profile-coops.js | 2 +- .../public/js/components/profile-general.js | 2 +- Server/public/js/components/profile-groups.js | 2 +- .../public/js/components/profile-parties.js | 2 +- .../js/components/reset-password-component.js | 1 + .../public/js/components/select-component.js | 2 +- .../public/js/components/signup-component.js | 2 +- .../public/js/components/switch-component.js | 2 +- Server/routes.jl | 2 + 44 files changed, 112 insertions(+), 37 deletions(-) create mode 100644 Server/app/resources/authentication/views/reset_password.jl.html create mode 100644 Server/app/svelte/src/auth/reset-password-component.svelte create mode 100644 Server/public/js/components/index-4da4d0ce.js create mode 100644 Server/public/js/components/index-6a7bc1e2.js create mode 100644 Server/public/js/components/reset-password-component.js diff --git a/Server/app/resources/authentication/AuthenticationController.jl b/Server/app/resources/authentication/AuthenticationController.jl index bd2f1a7..b34752d 100644 --- a/Server/app/resources/authentication/AuthenticationController.jl +++ b/Server/app/resources/authentication/AuthenticationController.jl @@ -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() diff --git a/Server/app/resources/authentication/views/reset_password.jl.html b/Server/app/resources/authentication/views/reset_password.jl.html new file mode 100644 index 0000000..dda6a2e --- /dev/null +++ b/Server/app/resources/authentication/views/reset_password.jl.html @@ -0,0 +1,2 @@ + + diff --git a/Server/app/svelte/rollup.config.js b/Server/app/svelte/rollup.config.js index bade40b..d9f00c2 100644 --- a/Server/app/svelte/rollup.config.js +++ b/Server/app/svelte/rollup.config.js @@ -10,7 +10,6 @@ import watch from "rollup-plugin-watch"; const production = !process.env.ROLLUP_WATCH; - function serve() { let server; diff --git a/Server/app/svelte/src/auth/login-component.svelte b/Server/app/svelte/src/auth/login-component.svelte index 17ffffc..0acbeeb 100644 --- a/Server/app/svelte/src/auth/login-component.svelte +++ b/Server/app/svelte/src/auth/login-component.svelte @@ -25,6 +25,7 @@ let googleButton let parentProps = getContext("auth") + let locale = "en" function renderGoogle() { if (parentProps.googleInit) { @@ -80,7 +81,7 @@ - + Forgot password?