Skip to content

Commit

Permalink
feat: auth (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
aahna-ashina committed Dec 27, 2023
1 parent 59c6c26 commit 50eecb9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/pages/api/[passportId]/auth/github-callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ const handler = nc()
session: false,
failureRedirect: failurePath
}),
(req, res) => {
// Successful authentication, redirect to /[passportId]/auth/github-success
// TODO
console.info('req:', req)
console.info('res:', res)
(req: any, res: any) => {
// Successful authentication
console.info('Successful authentication')

// Get GitHub username
const username: string = req.user.username
console.info('username', username)

// Redirect to /[passportId]/auth/github-success
res.redirect(`/233/auth/github-success?username=${username}`)
}
)

Expand Down

0 comments on commit 50eecb9

Please sign in to comment.