This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Joi valildation to middleware, hooks
- Loading branch information
1 parent
1d1faec
commit 1caed66
Showing
6 changed files
with
98 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 12 additions & 5 deletions
17
packages/marko-web-omeda-identity-x/integration-hooks/on-authentication-success.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
packages/marko-web-omeda-identity-x/integration-hooks/on-logout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
const Joi = require('@parameter1/joi'); | ||
const { validate } = require('@parameter1/joi/utils'); | ||
const olyticsCookie = require('@parameter1/base-cms-marko-web-omeda/olytics/customer-cookie'); | ||
|
||
module.exports = ({ res }) => { | ||
module.exports = (params = {}) => { | ||
const { | ||
res, | ||
} = validate(Joi.object({ | ||
res: Joi.object().required(), | ||
}).unknown(), params); | ||
olyticsCookie.clearFrom(res); | ||
}; |
28 changes: 18 additions & 10 deletions
28
packages/marko-web-omeda-identity-x/integration-hooks/on-user-profile-update.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters