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

Remember the last visited community #912

Merged
merged 5 commits into from
Jan 23, 2025
Merged

Conversation

kalilsn
Copy link
Member

@kalilsn kalilsn commented Jan 22, 2025

Issue(s) Resolved

Resolves #629

High-level Explanation of PR

Adds a cookie to keep track of the last visited community. We set it in the c/community layout file, and check it before our redirects on login, loading the login page when you're already logged in, and visiting /.

It's a bit convoluted because you can only set cookies from a server action. If there's a more sensible way to do this I would love to know!

Copy link
Contributor

@tefkah tefkah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functions great! i would change the cookie setting behavior to happen on the client though instead of through a server action, saves some interaction with our server and it's not really anything sensitive or important we'd need to compute on the server.

@kalilsn kalilsn requested a review from tefkah January 23, 2025 15:45
Copy link
Contributor

@tefkah tefkah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

@kalilsn kalilsn merged commit e3319e9 into main Jan 23, 2025
6 checks passed
@kalilsn kalilsn deleted the kalilsn/last-visited-community branch January 23, 2025 16:21
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 this pull request may close these issues.

Track last visited community and automatically send user to it on visit to app.pubpub.org
2 participants