mirror of
https://github.com/strapi/strapi.git
synced 2025-11-12 08:08:05 +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) => {
|
module.exports = async (ctx, next) => {
|
||||||
let role;
|
let role;
|
||||||
|
|
||||||
|
if (ctx.state.user) {
|
||||||
|
// request is already authenticated in a different way
|
||||||
|
return next();
|
||||||
|
}
|
||||||
|
|
||||||
// add the detection of `token` query parameter
|
// add the detection of `token` query parameter
|
||||||
if (
|
if (
|
||||||
(ctx.request && ctx.request.header && ctx.request.header.authorization) ||
|
(ctx.request && ctx.request.header && ctx.request.header.authorization) ||
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user