minor fixes

This commit is contained in:
Dieter Stinglhamber 2021-08-30 17:02:47 +02:00
parent bfcd119311
commit 6a4a4cc1f9
2 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,7 @@
'use strict';
module.exports = ({ env }) => ({
const { env } = require('@strapi/utils');
module.exports = {
salt: env('API_TOKEN_SALT'),
});
};

View File

@ -94,7 +94,10 @@ describe('API Token', () => {
apiTokenService.createSaltIfNotDefined();
expect(mockedAppendFile).toHaveBeenCalled();
expect(mockedAppendFile).toHaveBeenCalledWith(
'.env',
`API_TOKEN_SALT=${mockedApiToken.hexedString}\n`
);
expect(mockedConfigSet).toHaveBeenCalledWith(
'server.admin.api-token.salt',
mockedApiToken.hexedString