fb-register/login
This commit is contained in:
parent
5096950ce4
commit
7ac668132c
|
@ -1,15 +1,22 @@
|
|||
<script lang="ts">
|
||||
import './main.scss'
|
||||
import { i18n, isLoading as localeLoading } from '$lib/locales'
|
||||
import { isLoading as authLoading } from '$lib/appwrite'
|
||||
import { isLoading as authLoading, user } from '$lib/appwrite'
|
||||
import { onMount } from 'svelte'
|
||||
|
||||
import Routes from './__routes.svelte'
|
||||
import CookiesPopUp from '$lib/components/Cookies/CookiesPopUp.svelte'
|
||||
import { navigate } from '$lib/router'
|
||||
|
||||
let isMounted = false
|
||||
$: isReady = $localeLoading === false && $authLoading === false && isMounted
|
||||
|
||||
$: if (isReady && !$user) {
|
||||
if (!(location.pathname.startsWith('/login') || location.pathname.startsWith('/register'))) {
|
||||
navigate('/login')
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
/** init i18n */
|
||||
i18n()
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<script>
|
||||
import { account } from '$lib/appwrite'
|
||||
import HiddenInput from '../lib/Components/Inputs/Hidden_Input.svelte'
|
||||
import GoogleLogo from '../lib/svg/GoogleLogo.svelte'
|
||||
import TopImage from '../lib/svg/Top-Image.svelte'
|
||||
|
@ -46,7 +47,7 @@
|
|||
<p>Continue with Google</p>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<button on:click={() => account.createOAuth2Session('facebook')}>
|
||||
<p>Continue with Facebook</p>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
let password = 'aaaaaaaa'
|
||||
let repeatPassword = 'aaaaaaaa'
|
||||
let name = 'Ota Prokopec'
|
||||
$: console.log(password)
|
||||
|
||||
const register = async () => {
|
||||
//if (password === repeatPassword || name.length < 8 || email.length < 8) throw new Error('conditions are not fine')
|
||||
|
@ -62,8 +61,8 @@
|
|||
<input bind:value={email} type="text" placeholder="E-mail" autocomplete="email" required />
|
||||
<HiddenInput bind:value={password} placeholder="Password" />
|
||||
<HiddenInput bind:value={repeatPassword} placeholder="Re-type password" />
|
||||
<input class="cursor-pointer" on:click={() => register()} type="submit" value="Sign up" />
|
||||
</form>
|
||||
<button on:click={() => register()}>Sign up</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue