mirror of
https://github.com/nikdoof/pocket-id.git
synced 2025-12-14 15:22:18 +00:00
feat: automatically authorize client if signed in
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
import { startAuthentication } from '@simplewebauthn/browser';
|
import { startAuthentication } from '@simplewebauthn/browser';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import { LucideMail, LucideUser, LucideUsers } from 'lucide-svelte';
|
import { LucideMail, LucideUser, LucideUsers } from 'lucide-svelte';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
import { slide } from 'svelte/transition';
|
import { slide } from 'svelte/transition';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import ClientProviderImages from './components/client-provider-images.svelte';
|
import ClientProviderImages from './components/client-provider-images.svelte';
|
||||||
@@ -26,6 +27,12 @@
|
|||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
let { scope, nonce, client, state, callbackURL, codeChallenge, codeChallengeMethod } = data;
|
let { scope, nonce, client, state, callbackURL, codeChallenge, codeChallengeMethod } = data;
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
if ($userStore) {
|
||||||
|
authorize();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
async function authorize() {
|
async function authorize() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user