mirror of
https://github.com/strapi/strapi.git
synced 2025-12-25 06:04:29 +00:00
Check token salt on hash
This commit is contained in:
parent
ae23359954
commit
9afb0ad86d
@ -328,6 +328,12 @@ const getExpirationFields = (lifespan) => {
|
||||
* @returns {string}
|
||||
*/
|
||||
const hash = (accessKey) => {
|
||||
const { hasValidTokenSalt } = getService('transfer').utils;
|
||||
|
||||
if (!hasValidTokenSalt()) {
|
||||
throw new TypeError('Required token salt is not defined');
|
||||
}
|
||||
|
||||
return crypto
|
||||
.createHmac('sha512', strapi.config.get('admin.transfer.token.salt'))
|
||||
.update(accessKey)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user