Skip to content

Commit

Permalink
Merge pull request #179 from thevahidal/modify_auth_schema
Browse files Browse the repository at this point in the history
  • Loading branch information
thevahidal authored Apr 18, 2024
2 parents 5bbd1a0 + 73344d2 commit dbfee1e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "soul-cli",
"version": "0.7.3",
"version": "0.7.4",
"description": "A SQLite REST and Realtime server",
"main": "src/server.js",
"bin": {
Expand Down
22 changes: 16 additions & 6 deletions src/schemas/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const obtainAccessToken = Joi.object({
cookies: Joi.object({
refreshToken: Joi.string().optional(),
accessToken: Joi.string().optional(),
}),
}).unknown(true),
});

const refreshAccessToken = Joi.object({
Expand All @@ -24,7 +24,9 @@ const refreshAccessToken = Joi.object({
cookies: Joi.object({
refreshToken: Joi.string().required(),
accessToken: Joi.string().optional(),
}).required(),
})
.unknown(true)
.required(),
});

const changePassword = Joi.object({
Expand All @@ -40,7 +42,9 @@ const changePassword = Joi.object({
cookies: Joi.object({
accessToken: Joi.string().required(),
refreshToken: Joi.string().optional(),
}).required(),
})
.unknown(true)
.required(),
});

const registerUser = Joi.object({
Expand All @@ -56,7 +60,9 @@ const registerUser = Joi.object({
cookies: Joi.object({
accessToken: Joi.string().required(),
refreshToken: Joi.string().optional(),
}).required(),
})
.unknown(true)
.required(),
});

const updateRolePermissions = Joi.object({
Expand All @@ -76,7 +82,9 @@ const updateRolePermissions = Joi.object({
cookies: Joi.object({
accessToken: Joi.string().required(),
refreshToken: Joi.string().optional(),
}).required(),
})
.unknown(true)
.required(),
});

const removeAccessTokens = Joi.object({
Expand All @@ -86,7 +94,9 @@ const removeAccessTokens = Joi.object({
cookies: Joi.object({
refreshToken: Joi.string().required(),
accessToken: Joi.string().required(),
}).required(),
})
.unknown(true)
.required(),
});

module.exports = {
Expand Down

0 comments on commit dbfee1e

Please sign in to comment.