Skip to content

feat: support anonymous users#170

Merged
zhenghaoz merged 7 commits intogorse-io:masterfrom
zhangzhenghao:anonymous-repo-recommend
Apr 26, 2026
Merged

feat: support anonymous users#170
zhenghaoz merged 7 commits intogorse-io:masterfrom
zhangzhenghao:anonymous-repo-recommend

Conversation

@zhangzhenghao
Copy link
Copy Markdown
Contributor

  • 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)

zhangzhenghao and others added 6 commits April 26, 2026 11:53
- 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
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/repo now serves Gorse recommendations for authenticated users and random GitHub Trending repos for anonymous users (with 1-hour trending cache), and /api/read stores 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 docutils and mistune versions.

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.

Comment thread app.py
Comment thread frontend/src/views/Home.vue
Comment thread frontend/src/views/Home.vue Outdated
Comment thread frontend/src/views/Home.vue
Comment thread frontend/src/views/Home.vue
Comment thread app.py Outdated
Comment thread app.py
Comment thread frontend/src/views/Home.vue
Comment thread frontend/src/layouts/MainLayout.vue
Comment thread app.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@zhenghaoz zhenghaoz changed the title feat: support anonymous users in /api/repo endpoint feat: support anonymous users Apr 26, 2026
@zhenghaoz zhenghaoz merged commit edaf87b into gorse-io:master Apr 26, 2026
1 check passed
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.

3 participants