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

Using django-guest-user on the home page #12

Open
rcavezza opened this issue Jan 20, 2024 · 1 comment
Open

Using django-guest-user on the home page #12

rcavezza opened this issue Jan 20, 2024 · 1 comment
Labels
question Further information is requested

Comments

@rcavezza
Copy link

I'm using django-guest-user on my home page to allow visitors to get some use out of the website before forcing them to register as users. The problem is (and I can't figure a way around it yet) is dealing with user Login after a user visits the homepage. Since I only @allow_guest_user on the homepage, I assumed that if you clicked to login, it would stop the guest user experience, but I'm assuming that isn't exactly how it works.

Are there any tricks or workarounds to allowing logins for someone considered a "guest user" who is actually another user logged out who is visiting the site?

Thanks again for the package - this is solving a huge use case for me!

@julianwachholz
Copy link
Owner

Hey @rcavezza, thank you for the kind words and bringing up this discussion.

Logging in to an existing account while already authenticated as a guest user should work as expected. The only requirement for this to work is that your login page doesn't redirect already-authenticated users elsewhere.
With django-allauth for example, this requires the setting ACCOUNT_AUTHENTICATED_LOGIN_REDIRECTS = False.

However, this means if an existing user interacts with your sites and notices too late that they're not logged in to their real account, they could face loss of data. A sort of user merging needs to happen in this case, which unfortunately can't happen automatically at this time.
There has been a previous discussion about this over a decade ago (by yours truly!). Does it sound similar to the problem you're facing?

@julianwachholz julianwachholz added the question Further information is requested label Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants