Move password/setup.html -> account/setup.html
This commit is contained in:
+2
-2
@@ -236,7 +236,7 @@ function sendInvite(user, invitor) {
|
||||
var templateData = {
|
||||
user: user,
|
||||
webadminUrl: config.adminOrigin(),
|
||||
setupLink: config.adminOrigin() + '/api/v1/session/password/setup.html?reset_token=' + user.resetToken,
|
||||
setupLink: config.adminOrigin() + '/api/v1/session/account/setup.html?reset_token=' + user.resetToken,
|
||||
format: 'text',
|
||||
fqdn: config.fqdn(),
|
||||
invitor: invitor
|
||||
@@ -263,7 +263,7 @@ function userAdded(user, inviteSent) {
|
||||
|
||||
adminEmails = _.difference(adminEmails, [ user.email ]);
|
||||
|
||||
var inviteLink = inviteSent ? null : config.adminOrigin() + '/api/v1/session/password/setup.html?reset_token=' + user.resetToken;
|
||||
var inviteLink = inviteSent ? null : config.adminOrigin() + '/api/v1/session/account/setup.html?reset_token=' + user.resetToken;
|
||||
|
||||
var mailOptions = {
|
||||
from: config.adminEmail(),
|
||||
|
||||
@@ -268,8 +268,8 @@ function passwordSentSite(req, res) {
|
||||
renderTemplate(res, 'password_reset_sent', { adminOrigin: config.adminOrigin(), title: 'Cloudron Password Reset' });
|
||||
}
|
||||
|
||||
// -> GET /api/v1/session/password/setup.html
|
||||
function passwordSetupSite(req, res, next) {
|
||||
// -> GET /api/v1/session/account/setup.html
|
||||
function accountSetupSite(req, res, next) {
|
||||
if (!req.query.reset_token) return next(new HttpError(400, 'Missing reset_token'));
|
||||
|
||||
user.getByResetToken(req.query.reset_token, function (error, user) {
|
||||
@@ -472,7 +472,7 @@ exports = module.exports = {
|
||||
passwordResetRequest: passwordResetRequest,
|
||||
passwordSentSite: passwordSentSite,
|
||||
passwordResetSite: passwordResetSite,
|
||||
passwordSetupSite: passwordSetupSite,
|
||||
accountSetupSite: accountSetupSite,
|
||||
passwordReset: passwordReset,
|
||||
authorization: authorization,
|
||||
token: token,
|
||||
|
||||
@@ -1325,7 +1325,7 @@ describe('Password', function () {
|
||||
});
|
||||
|
||||
it('setup fails due to missing reset_token', function (done) {
|
||||
superagent.get(SERVER_URL + '/api/v1/session/password/setup.html')
|
||||
superagent.get(SERVER_URL + '/api/v1/session/account/setup.html')
|
||||
.end(function (error, result) {
|
||||
expect(result.statusCode).to.equal(400);
|
||||
done();
|
||||
@@ -1333,7 +1333,7 @@ describe('Password', function () {
|
||||
});
|
||||
|
||||
it('setup fails due to invalid reset_token', function (done) {
|
||||
superagent.get(SERVER_URL + '/api/v1/session/password/setup.html')
|
||||
superagent.get(SERVER_URL + '/api/v1/session/account/setup.html')
|
||||
.query({ reset_token: hat(256) })
|
||||
.end(function (error, result) {
|
||||
expect(result.statusCode).to.equal(401);
|
||||
@@ -1342,7 +1342,7 @@ describe('Password', function () {
|
||||
});
|
||||
|
||||
it('setup succeeds', function (done) {
|
||||
superagent.get(SERVER_URL + '/api/v1/session/password/setup.html')
|
||||
superagent.get(SERVER_URL + '/api/v1/session/account/setup.html')
|
||||
.query({ reset_token: USER_0.resetToken })
|
||||
.end(function (error, result) {
|
||||
expect(result.statusCode).to.equal(200);
|
||||
|
||||
+1
-1
@@ -126,9 +126,9 @@ function initializeExpressSync() {
|
||||
router.get ('/api/v1/session/password/resetRequest.html', csrf, routes.oauth2.passwordResetRequestSite);
|
||||
router.post('/api/v1/session/password/resetRequest', csrf, routes.oauth2.passwordResetRequest);
|
||||
router.get ('/api/v1/session/password/sent.html', routes.oauth2.passwordSentSite);
|
||||
router.get ('/api/v1/session/password/setup.html', csrf, routes.oauth2.passwordSetupSite);
|
||||
router.get ('/api/v1/session/password/reset.html', csrf, routes.oauth2.passwordResetSite);
|
||||
router.post('/api/v1/session/password/reset', csrf, routes.oauth2.passwordReset);
|
||||
router.get ('/api/v1/session/account/setup.html', csrf, routes.oauth2.accountSetupSite);
|
||||
|
||||
// oauth2 routes
|
||||
router.get ('/api/v1/oauth/dialog/authorize', routes.oauth2.authorization);
|
||||
|
||||
Reference in New Issue
Block a user