Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite redirect loop after login with <ThinBackend requireLogin> #28

Closed
jokull opened this issue Apr 28, 2022 · 5 comments · Fixed by digitallyinduced/thin-next-starter#2

Comments

@jokull
Copy link

jokull commented Apr 28, 2022

I am testing a completely vanilla Vercel template repo here

I get presented with a login screen. After a successful signup and login I get redirected back but in a loop bringing it back to login, the redirecting etc.

@mpscholten
Copy link
Member

Thanks!

Looking into that.

The vercel repo seems like it's private as it gives an 404.

@jokull
Copy link
Author

jokull commented Apr 28, 2022

Fixed!

@mpscholten
Copy link
Member

Thanks. I think I've found the issue:

Inside the pages/index.ts we have this:

  useEffect(() => {
      ensureIsUser(); // Trigger login
  }, []);

This needs to be removed as we already set requireLogin in <ThinBackend requireLogin/>.

The ensureIsUser() was an old way to handle what requireLogin already does :) So we just forgot to remove it here 👍 Will remove it from the template in a minute.

@jokull
Copy link
Author

jokull commented Apr 28, 2022

Thanks that fixed it.

@mpscholten
Copy link
Member

Perfect thanks 👍 Merged the fix into the template ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants