feat: support anonymous users#170
Merged
zhenghaoz merged 7 commits intogorse-io:masterfrom Apr 26, 2026
Merged
Conversation
Contributor
zhangzhenghao
commented
Apr 26, 2026
- Remove @login_required decorator from get_repo
- Logged-in users: continue using Gorse recommendation system
- Anonymous users: randomly select a repo from GitHub Trending
- Use global_github_client for anonymous users (no user token required)
- Cache trending data for performance (1 hour expiry)
- Remove @login_required decorator from get_repo - Logged-in users: continue using Gorse recommendation system - Anonymous users: randomly select a repo from GitHub Trending - Use global_github_client for anonymous users (no user token required) - Cache trending data for performance
- Remove @login_required from read_repo endpoint - Logged-in users: continue using Gorse feedback system - Anonymous users: save read repos to Flask session - get_repo: filter out read repos when selecting from trending - Auto-reset session when all trending repos have been read
- Remove requiresAuth from Explore and Explore Topic routes - Add isAuthenticated state check in MainLayout - Hide Favorites button for anonymous users - Hide AI topic tab for anonymous users - Show login icon instead of logout for anonymous users - 401 interceptor only redirects on Favorites page
- Add isAuthenticated state check in Home.vue - Add checkAuth method to verify auth status on mount - like() method redirects to /login if not authenticated
- Show v-banner at top of Explore page for anonymous users - Message: 'Login with GitHub to get personalized recommendations' - Include Login and Dismiss buttons - User can dismiss the banner temporarily
… and improved login prompts
There was a problem hiding this comment.
Pull request overview
Adds anonymous-user support for the repository recommendation flow by removing the auth requirement on /api/repo and adapting the frontend to allow browsing without logging in while still prompting users to authenticate for personalized features.
Changes:
- Backend:
/api/reponow serves Gorse recommendations for authenticated users and random GitHub Trending repos for anonymous users (with 1-hour trending cache), and/api/readstores anonymous “read” state in session. - Frontend: Explore routes no longer require auth; UI now checks auth state, shows login prompts, and hides auth-only navigation/actions when anonymous.
- Dependencies: bumps
docutilsandmistuneversions.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| requirements.txt | Updates pinned versions for doc rendering dependencies. |
| frontend/src/views/Home.vue | Adds auth check + login prompt; blocks “like” for anonymous users. |
| frontend/src/main.js | Removes auth requirement from Explore routes; narrows 401 redirect behavior. |
| frontend/src/layouts/MainLayout.vue | Hides Favorites/logout for anonymous users; adds login/logout buttons; filters topics. |
| app.py | Removes login requirement for /api/repo and /api/read; implements anonymous trending-based selection and caching. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.