0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Renamed /passwordreset Authentication API endpoint to /password_reset

refs https://github.com/TryGhost/Toolbox/issues/308

- we have the pattern of splitting words in API endpoints with an
  underscore but this was an exception we want to clean up in v5
This commit is contained in:
Daniel Lockyer 2022-04-25 16:16:35 +01:00
parent 8473298072
commit c4f3d44baa
No known key found for this signature in database
GPG key ID: D21186F0B47295AD
2 changed files with 7 additions and 7 deletions

View file

@ -218,12 +218,12 @@ module.exports = function apiRoutes() {
router.get('/identities', mw.authAdminApi, http(api.identities.read));
// ## Authentication
router.post('/authentication/passwordreset',
router.post('/authentication/password_reset',
shared.middleware.brute.globalReset,
shared.middleware.brute.userReset,
http(api.authentication.generateResetToken)
);
router.put('/authentication/passwordreset', shared.middleware.brute.globalBlock, http(api.authentication.resetPassword));
router.put('/authentication/password_reset', shared.middleware.brute.globalBlock, http(api.authentication.resetPassword));
router.post('/authentication/invitation', http(api.authentication.acceptInvitation));
router.get('/authentication/invitation', http(api.authentication.isInvitation));
router.post('/authentication/setup', http(api.authentication.setup));

View file

@ -347,7 +347,7 @@ describe('Authentication API', function () {
password: ownerUser.get('password')
});
await agent.put('authentication/passwordreset')
await agent.put('authentication/password_reset')
.header('Accept', 'application/json')
.body({
passwordreset: [{
@ -365,7 +365,7 @@ describe('Authentication API', function () {
it('reset password: invalid token', async function () {
await agent
.put('authentication/passwordreset')
.put('authentication/password_reset')
.header('Accept', 'application/json')
.body({
passwordreset: [{
@ -397,7 +397,7 @@ describe('Authentication API', function () {
});
await agent
.put('authentication/passwordreset')
.put('authentication/password_reset')
.header('Accept', 'application/json')
.body({
passwordreset: [{
@ -426,7 +426,7 @@ describe('Authentication API', function () {
});
await agent
.put('authentication/passwordreset')
.put('authentication/password_reset')
.header('Accept', 'application/json')
.body({
passwordreset: [{
@ -448,7 +448,7 @@ describe('Authentication API', function () {
it('reset password: generate reset token', async function () {
await agent
.post('authentication/passwordreset')
.post('authentication/password_reset')
.header('Accept', 'application/json')
.body({
passwordreset: [{