mirror of
https://github.com/strapi/strapi.git
synced 2025-11-30 17:18:24 +00:00
Merge pull request #16705 from strapi/fix/generate-admin-user-hash
This commit is contained in:
commit
833f017981
@ -10,7 +10,7 @@ const crypto = require('crypto');
|
||||
*/
|
||||
const generateAdminUserHash = (strapi) => {
|
||||
const ctx = strapi?.requestContext?.get();
|
||||
if (!ctx?.state?.user) {
|
||||
if (!ctx?.state?.user?.email) {
|
||||
return '';
|
||||
}
|
||||
return crypto.createHash('sha256').update(ctx.state.user.email).digest('hex');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user