diff --git a/dashboard/src/js/client.js b/dashboard/src/js/client.js index ca9aa5f82..6cfaa2a6c 100644 --- a/dashboard/src/js/client.js +++ b/dashboard/src/js/client.js @@ -2296,7 +2296,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout }; Client.prototype.getBackgroundImageUrl = function () { - return client.apiOrigin + '/api/v1/profile/backgroundImage?access_token=' + token + '&bustcache=' + Date.now(); + return client.apiOrigin + '/api/v1/profile/background_image?access_token=' + token + '&bustcache=' + Date.now(); }; Client.prototype.setBackgroundImage = function (backgroundImage, callback) { @@ -2309,7 +2309,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout transformRequest: angular.identity }; - post('/api/v1/profile/backgroundImage', fd, config, function (error, data, status) { + post('/api/v1/profile/background_image', fd, config, function (error, data, status) { if (error) return callback(error); if (status !== 202) return callback(new ClientError(status, data)); callback(null); diff --git a/src/nginxconfig.ejs b/src/nginxconfig.ejs index 976d1432f..257b5dbe1 100644 --- a/src/nginxconfig.ejs +++ b/src/nginxconfig.ejs @@ -251,7 +251,7 @@ server { client_max_body_size 0; } - location ~ ^/api/v1/profile/backgroundImage { + location ~ ^/api/v1/profile/background_image { proxy_pass http://127.0.0.1:3000; client_max_body_size 0; } diff --git a/src/server.js b/src/server.js index d33add7ac..0ca61ebbe 100644 --- a/src/server.js +++ b/src/server.js @@ -162,8 +162,8 @@ async function initializeExpressSync() { router.post('/api/v1/profile', json, token, authorizeUser, routes.profile.authorize, routes.profile.update); router.get ('/api/v1/profile/avatar/:identifier', routes.profile.getAvatar); // this is not scoped so it can used directly in img tag router.post('/api/v1/profile/avatar', json, token, authorizeUser, (req, res, next) => { return typeof req.body.avatar === 'string' ? next() : multipart(req, res, next); }, routes.profile.setAvatar); // avatar is not exposed in LDAP. so it's personal and not locked - router.get ('/api/v1/profile/backgroundImage', token, authorizeUser, routes.profile.getBackgroundImage); - router.post('/api/v1/profile/backgroundImage', token, authorizeUser, multipart, routes.profile.setBackgroundImage); // backgroundImage is not exposed in LDAP. so it's personal and not locked + router.get ('/api/v1/profile/background_image', token, authorizeUser, routes.profile.getBackgroundImage); + router.post('/api/v1/profile/background_image', token, authorizeUser, multipart, routes.profile.setBackgroundImage); // backgroundImage is not exposed in LDAP. so it's personal and not locked router.post('/api/v1/profile/password', json, token, authorizeUser, routes.users.verifyPassword, routes.profile.setPassword); router.post('/api/v1/profile/twofactorauthentication_secret', json, token, authorizeUser, routes.profile.setTwoFactorAuthenticationSecret); router.post('/api/v1/profile/twofactorauthentication_enable', json, token, authorizeUser, routes.profile.enableTwoFactorAuthentication);