netlify-identity-demo-svelte icon indicating copy to clipboard operation
netlify-identity-demo-svelte copied to clipboard

A sapper version would be nice too.

Open quantuminformation opened this issue 5 years ago • 8 comments

Advantages of Sapper:

  • You don't need to store the token locally, you can use sessions which store to token on page hydration
  • Local storage is considered to have weak security for access tokens

quantuminformation avatar Nov 12 '19 19:11 quantuminformation

@QuantumInformation I totally agree! I'll start drafting one up and let ya know when it's up if you like.

babycourageous avatar Nov 12 '19 20:11 babycourageous

Cool, I'm not sure how you would pull it off with a static export though which is my use case for netlify.

quantuminformation avatar Nov 12 '19 21:11 quantuminformation

So I've been trying it with a sapper app and browser stuff is not available, so just to get things to work on sapper local dev I am trying stuff like:

function createUser() {
  const localUser = process.browser
    ? JSON.parse(localStorage.getItem('gotrue.user'))
    : undefined

anyway, looks like the best way to do this would be some http-only cookie getting the user on runtime vie a onMount method.

quantuminformation avatar Nov 14 '19 20:11 quantuminformation

Do you mind if I make a mention of this repo in my youtube videos? btw do you have a contact email or smth?

Want to contrast it to SSR type authentication: https://www.youtube.com/playlist?list=PLCrwuqjmVebK08Cwz_XB55cNKFfFYOMGo

quantuminformation avatar Nov 17 '19 13:11 quantuminformation

No sweat at all! Thanks for asking!

I don't have anything really besides my personal email.

babycourageous avatar Nov 18 '19 03:11 babycourageous

Any update on a Sapper version?

WeAreELIC avatar Jun 11 '20 17:06 WeAreELIC

@WeAreELIC I actually had this on my backburner but I haven't had a chance unfortunately.

I haven't grabbed Sapper in a while. Maybe this is a good reason to jog my memory. Sorry I don't have more of an update for ya.

babycourageous avatar Jun 11 '20 20:06 babycourageous

its hard when your working to do open source, at least for me)

quantuminformation avatar Jun 11 '20 20:06 quantuminformation