mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
Fix password change issue.
This commit is contained in:
parent
1cfb9e18a1
commit
bde1949e8f
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "umami",
|
"name": "umami",
|
||||||
"version": "0.33.0",
|
"version": "0.34.0",
|
||||||
"description": "A simple, fast, website analytics alternative to Google Analytics. ",
|
"description": "A simple, fast, website analytics alternative to Google Analytics. ",
|
||||||
"author": "Mike Cao <mike@mikecao.com>",
|
"author": "Mike Cao <mike@mikecao.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -6,10 +6,10 @@ import { checkPassword, hashPassword } from 'lib/crypto';
|
|||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
await useAuth(req, res);
|
await useAuth(req, res);
|
||||||
|
|
||||||
const { user_id, is_admin } = req.auth;
|
const { user_id: auth_user_id, is_admin } = req.auth;
|
||||||
const { current_password, new_password } = req.body;
|
const { user_id, current_password, new_password } = req.body;
|
||||||
|
|
||||||
if (is_admin) {
|
if (!is_admin || user_id !== auth_user_id) {
|
||||||
return unauthorized(res);
|
return unauthorized(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user