netlify-labs / react-netlify-identity

a tiny (4kb) React hook for using Netlify Identity, no UI. SEEKING MAINTAINERS
https://netlify-gotrue-in-react.netlify.com/
156 stars 25 forks source link

isLoggedIn always false #7

Closed YChebotaev closed 5 years ago

YChebotaev commented 5 years ago

After successfully confirm email with approach described here, I'm trying to log in.

Then, when I enter email and password and invoke loginUser with them, I expect to isLoggedIn to be true.

But isLoggedIn flag always returns false for me.

How I can overcome this obstacle?

swyxio commented 5 years ago

something has to be up with your implementation. have you seen how the demo works? how does your implementation differ?

YChebotaev commented 5 years ago

@sw-yx Your demo also not working properly: after page reload I lost all my authentication.

I'm enter in the URL section link to my service's URL and trying to log in. After successful log in I can see private part.

But after page reload I expect to continue see private part, but instead I see login form again.

swyxio commented 5 years ago

yeah thats because i havent updated to use this: https://github.com/sw-yx/react-netlify-identity/pull/2

should be a simple fix.

i'm sorry you're facing so much trouble - as the readme says this is not an official netlify project. even tho i'm a netlify employee i did this in my own time just because i'm a react fan. at this stage in the project's life i need people who can contribute their own bugfixes.

that said, i'm currently working on a new demo that uses react netlify identity. so this feedback -is- helpful and i will keep it in mind. i just dont want to promise i can solve your issue straight away esp when i can't see your repo.

swyxio commented 5 years ago

hey @YChebotaev - so it was a simple error - i forgot to set the remember flag to true :) https://github.com/sw-yx/react-netlify-identity/commit/a8a8106c9317228848c349487b8626040bc5ebf0

now if you go to https://netlify-gotrue-in-react.netlify.com/dashboard and login and refresh, it persists. sorry for the bad demo. but thanks for reporting the problem.