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