Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions server/api/auth/atproto.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ export default defineEventHandler(async event => {
handleResolver,
})

const error = query.error

// user cancelled explicitly
if (error === 'access_denied') {
Comment on lines +73 to +76
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const error = query.error
// user cancelled explicitly
if (error === 'access_denied') {
// user cancelled explicitly
if (query.error === 'access_denied') {

const returnToURL = getCookie(event, 'auth_return_to') || '/'
deleteCookie(event, 'auth_return_to', { path: '/' })
return sendRedirect(event, returnToURL)
}

if (!query.code) {
// Validate returnTo is a safe relative path (prevent open redirect)
// Only set cookie on initial auth request, not the callback
Expand Down
Loading