Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux authored Jan 21, 2025
1 parent 8f43c47 commit a4c5855
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/runtime/server/lib/oauth/atlassian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,23 @@ export function defineOAuthAtlassianEventHandler({
})

if (user.account_status === 'inactive') {
throw createError({
const error = createError({
statusCode: 403,
statusMessage: 'Atlassian account is inactive',
data: { accountStatus: user.account_status },
})
if (!onError) throw error
return onError(event, error)
}

if (!user.email_verified) {
throw createError({
const error = createError({
statusCode: 400,
statusMessage: 'Email address is not verified',
data: { email: user.email },
})
if (!onError) throw error
return onError(event, error)
}

return onSuccess(event, {
Expand Down

0 comments on commit a4c5855

Please sign in to comment.