Skip to content

babycourageous/netlify-identity-demo-svelte

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netlify Identity Demo in Svelte

Introduction

Features:

This project was bootstrapped with the starter Svelte template by running npx degit sveltejs/template <PROJECT_NAME> and uses Netlify Identity for authentication. It was influenced by the the React example by @sw-yx and the Vue example by @medmin

Local Storage

This example uses the gotrue.user key in Local Storage to determine if a user is already signed in and then stores that in a Svelte store. Since Netlify Identity does that already it means we don't have to maintain our own Local Storage info.

Redirects

The functionality of redirecting a user after logging in to whichever protected page they were coming from is mocked up in the Protected route by storing a redirect URL stored in a Svelte store.

Gotchas

If you are developing with the Netlify Identity Widget locally you will be prompted for a deployed Netlify Identity site (more info in the Localhost section of the Netlify Identity Widget README). Sometimes this causes issues with email verification or confirmation and you may need to reset the site.

To clear the locally stored Netlify Identity site you previously entered, execute localStorage.removeItem('netlifySiteURL'); in your window.

About

A demo of the Netlify Identity Widget in Svelte.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published