mirror of
https://github.com/strapi/strapi.git
synced 2025-08-27 18:25:49 +00:00
Allow query params for /me
This commit is contained in:
parent
291e2b6835
commit
64852e9cda
@ -95,7 +95,6 @@ module.exports = {
|
||||
throw new NotFoundError(`User not found`);
|
||||
}
|
||||
|
||||
|
||||
await validateUpdateUserBody(ctx.request.body);
|
||||
|
||||
if (user.provider === 'local' && _.has(ctx.request.body, 'password') && !password) {
|
||||
@ -186,12 +185,15 @@ module.exports = {
|
||||
* @return {Object|Array}
|
||||
*/
|
||||
async me(ctx) {
|
||||
const user = ctx.state.user;
|
||||
const authUser = ctx.state.user;
|
||||
const { query } = ctx;
|
||||
|
||||
if (!user) {
|
||||
if (!authUser) {
|
||||
return ctx.unauthorized();
|
||||
}
|
||||
|
||||
const user = await getService('user').fetch(authUser.id, query);
|
||||
|
||||
ctx.body = await sanitizeOutput(user, ctx);
|
||||
},
|
||||
};
|
||||
|
@ -14,7 +14,6 @@ module.exports = [
|
||||
path: '/users',
|
||||
handler: 'user.find',
|
||||
config: {
|
||||
auth: {},
|
||||
prefix: '',
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user