mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-09-14 10:52:34 +00:00
Notification toasts, nicer loading, add new user support
This commit is contained in:
@@ -134,24 +134,24 @@ export default {
|
||||
* @param {Object} user
|
||||
* @returns {Promise}
|
||||
*/
|
||||
getTokenFromUser: (user) => {
|
||||
getTokenFromUser: async (user) => {
|
||||
const expire = "1d";
|
||||
const Token = new TokenModel();
|
||||
const expiry = parseDatePeriod(expire);
|
||||
|
||||
return Token.create({
|
||||
const signed = await Token.create({
|
||||
iss: "api",
|
||||
attrs: {
|
||||
id: user.id,
|
||||
},
|
||||
scope: ["user"],
|
||||
expiresIn: expire,
|
||||
}).then((signed) => {
|
||||
return {
|
||||
token: signed.token,
|
||||
expires: expiry.toISOString(),
|
||||
user: user,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
token: signed.token,
|
||||
expires: expiry.toISOString(),
|
||||
user: user,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
@@ -337,11 +337,11 @@ const internalUser = {
|
||||
* @param {Integer} [id_requested]
|
||||
* @returns {[String]}
|
||||
*/
|
||||
getUserOmisionsByAccess: (access, id_requested) => {
|
||||
getUserOmisionsByAccess: (access, idRequested) => {
|
||||
let response = []; // Admin response
|
||||
|
||||
if (!access.token.hasScope("admin") && access.token.getUserId(0) !== id_requested) {
|
||||
response = ["roles", "is_deleted"]; // Restricted response
|
||||
if (!access.token.hasScope("admin") && access.token.getUserId(0) !== idRequested) {
|
||||
response = ["is_deleted"]; // Restricted response
|
||||
}
|
||||
|
||||
return response;
|
||||
|
Reference in New Issue
Block a user