Skip to content

Commit 7176f76

Browse files
committed
fix: set appropriate response status for user not found and authentication errors
1 parent d87c7ea commit 7176f76

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ export default class OAuthPlugin extends AdminForthPlugin {
228228
if (!user) {
229229
// Check if open signup is enabled
230230
if (!this.options.openSignup?.enabled) {
231+
response.setStatus(403);
231232
return {
232233
error: 'User with your email is not registered in system and signup is not allowed. Please contact your administrator to get access to the system'
233234
};
@@ -303,6 +304,7 @@ export default class OAuthPlugin extends AdminForthPlugin {
303304
});
304305
} catch (error) {
305306
console.error('OAuth authentication error:', error);
307+
response.setStatus(400);
306308
return {
307309
error: `Authentication failed: ${error}`
308310
};

0 commit comments

Comments
 (0)