From e67a66c7ae17449e363bf5bc9f532f74a522bc0f Mon Sep 17 00:00:00 2001 From: Ota Prokopec Date: Sun, 19 Mar 2023 13:52:36 +0100 Subject: [PATCH] register-login fix / Erant map scaling fix --- index.html | 126 ++++++++++-------- src/lib/components/Buttons/Button.svelte | 5 + src/lib/components/Map/Erantmap.svelte | 2 +- src/routes/authorization/login/log_in.svelte | 7 +- .../authorization/register/register.svelte | 3 + .../utils/authorizationErrors.ts | 2 +- 6 files changed, 84 insertions(+), 61 deletions(-) diff --git a/index.html b/index.html index e875a96..89ae76b 100644 --- a/index.html +++ b/index.html @@ -1,66 +1,80 @@ + + + + + + Erant - - - - - - Erant + + - - + + + + - - - - + + + - - gtag('config', 'G-8RCL0H1Q7V'); - + + + + - - - - - - - - - - - -
- - + + + + +
+ + diff --git a/src/lib/components/Buttons/Button.svelte b/src/lib/components/Buttons/Button.svelte index 413989d..20bc686 100644 --- a/src/lib/components/Buttons/Button.svelte +++ b/src/lib/components/Buttons/Button.svelte @@ -41,6 +41,11 @@ color: white; background-color: rgb(66, 99, 235); + &.disabled { + &:hover { + background-color: rgb(107 114 128); + } + } &:hover { background-color: rgba(66, 99, 235, 0.8); } diff --git a/src/lib/components/Map/Erantmap.svelte b/src/lib/components/Map/Erantmap.svelte index 42acca4..4d2a0e6 100644 --- a/src/lib/components/Map/Erantmap.svelte +++ b/src/lib/components/Map/Erantmap.svelte @@ -22,7 +22,7 @@ }) }) })()*/ - navigator.geolocation.getCurrentPosition((e) => {}) //at mapbox this is required dont know why + //navigator.geolocation.getCurrentPosition((e) => {}) //at mapbox this is required dont know why /* if (navigator.geolocation) { navigator.geolocation.watchPosition(showPosition, () => dispatch('locationFailed')) diff --git a/src/routes/authorization/login/log_in.svelte b/src/routes/authorization/login/log_in.svelte index ac1dc1a..0362ae8 100644 --- a/src/routes/authorization/login/log_in.svelte +++ b/src/routes/authorization/login/log_in.svelte @@ -7,6 +7,7 @@ import TopImage from '$lib/svg/Top-Image.svelte' import { Helper } from 'flowbite-svelte' import { getErrorMessage } from '../utils/authorizationErrors' + import Button from '$lib/components/Buttons/Button.svelte' export let purpose = 'login' //possible values login, register @@ -58,13 +59,13 @@
Forgot password?
- + diff --git a/src/routes/authorization/register/register.svelte b/src/routes/authorization/register/register.svelte index b469ecb..ce532ad 100644 --- a/src/routes/authorization/register/register.svelte +++ b/src/routes/authorization/register/register.svelte @@ -30,11 +30,14 @@ err['code'] = 1001 throw err } + await account.create(ID.unique(), email, password, name) await account.createEmailSession(email, password) await account.createVerification(`${location.origin}/register/emailverification/${erantId}`) state = 'email-sent' } catch (err) { + console.log(err) + error = getErrorMessage(err.code) state = 'register' } diff --git a/src/routes/authorization/utils/authorizationErrors.ts b/src/routes/authorization/utils/authorizationErrors.ts index 575a202..c40dbaa 100644 --- a/src/routes/authorization/utils/authorizationErrors.ts +++ b/src/routes/authorization/utils/authorizationErrors.ts @@ -2,7 +2,7 @@ export const errors = { 1001: 'Nickname is already taken', 409: 'A user with the same email already is in Erant', 401: 'Invalid credentials.', - 400: 'Password must be at least 8 characters.', + 400: 'Email musts be valid.', } export const getErrorMessage = (code: number) => {