Skip to content

Commit 0d5b507

Browse files
authored
Merge pull request #9 from devforth/feature/AdminForth/1611/display-the-appropriate-respon
fix: set appropriate response status for user not found and authentic…
2 parents d87c7ea + a0cb0d2 commit 0d5b507

3 files changed

Lines changed: 60 additions & 6 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
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"description": "AdminForth OAuth Plugin",
2727
"devDependencies": {
2828
"@types/node": "^22.10.7",
29-
"adminforth": "^2.50.0",
29+
"adminforth": "2.56.0-next.14",
3030
"semantic-release": "^24.2.1",
3131
"semantic-release-slack-bot": "^4.0.2",
3232
"typescript": "^5.7.3"

pnpm-lock.yaml

Lines changed: 57 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)