We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da4a963 commit 8252800Copy full SHA for 8252800
server/api/auth/atproto.get.ts
@@ -70,6 +70,15 @@ export default defineEventHandler(async event => {
70
handleResolver,
71
})
72
73
+ const error = query.error
74
+
75
+ // user cancelled explicitly
76
+ if (error === 'access_denied') {
77
+ const returnToURL = getCookie(event, 'auth_return_to') || '/'
78
+ deleteCookie(event, 'auth_return_to', { path: '/' })
79
+ return sendRedirect(event, returnToURL)
80
+ }
81
82
if (!query.code) {
83
// Validate returnTo is a safe relative path (prevent open redirect)
84
// Only set cookie on initial auth request, not the callback
0 commit comments