Skip to content

frontend: add auth store, LoginPage, and AuthCallback - #30

Merged
MekDrop merged 1 commit into
mainfrom
feat/issue-8-auth-ui
Apr 23, 2026
Merged

MekDrop merged 1 commit into
mainfrom
feat/issue-8-auth-ui

Conversation

@MekDrop

@MekDrop MekDrop commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add frontend/src/services/github.js with fetchCurrentUser(token) for GitHub API calls
  • Add frontend/src/stores/auth.js — Pinia setup store with isLoggedIn getter, loginWithToken, and logout actions; hydrates from localStorage on creation
  • Add frontend/src/pages/LoginPage.vue — GitHub OAuth redirect and GitLab PKCE login with host input and error banner support
  • Add frontend/src/pages/AuthCallback.vue — handles both /auth/github and /auth/gitlab redirect callbacks, exchanges tokens and redirects to /repos
  • Update frontend/src/router/routes.js to register the three new routes under MainLayout

Closes #8

Test plan

  • Navigate to /#/login — GitHub and GitLab login buttons are visible
  • Clicking "Login with GitHub" redirects to GitHub OAuth with correct client_id and redirect_uri
  • Clicking "Login with GitLab" (with host filled in) starts the PKCE flow
  • /#/login?error=no_token shows the error banner
  • After a successful GitHub callback, auth state is persisted in localStorage and the user is redirected to /repos
  • After a successful GitLab callback, same behaviour as above
  • logout() clears state and removes the localStorage key
  • Refreshing the page restores auth state from localStorage

@MekDrop
MekDrop merged commit 225c7b4 into main Apr 23, 2026
1 check passed
@MekDrop
MekDrop deleted the feat/issue-8-auth-ui branch April 23, 2026 00:30
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.

Frontend: auth Pinia store + LoginPage + AuthCallback page

1 participant