mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
Upgrade api token tuto to not break rbac feature (#7250)
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
c3f4afca87
commit
cba02febf2
@ -44,6 +44,11 @@ const _ = require('lodash');
|
||||
module.exports = async (ctx, next) => {
|
||||
let role;
|
||||
|
||||
if (ctx.state.user) {
|
||||
// request is already authenticated in a different way
|
||||
return next();
|
||||
}
|
||||
|
||||
// add the detection of `token` query parameter
|
||||
if (
|
||||
(ctx.request && ctx.request.header && ctx.request.header.authorization) ||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user