feat: add silent login on load.

This commit is contained in:
Darrel O'Pry 2020-08-12 20:01:43 -04:00
parent 356f437331
commit 27577a876a
2 changed files with 5 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@dopry/svelte-oidc",
"version": "0.2.1",
"version": "0.3.0",
"repository": "https://github.com/dopry/svelte-oidc",
"description": "Svelte OIDC Component Library",
"keywords": [

View file

@ -118,6 +118,10 @@
// Not all browsers support this, please program defensively!
const params = new URLSearchParams(window.location.search);
if (!params.has('error') && !params.has('code') && !$isAuthenticated) {
refreshToken();
}
async function handleOnMount() {
// on run onMount after oidc
const oidc = await oidcPromise;