From: Rigel Kent Date: Fri, 7 Dec 2018 00:42:00 +0000 (+0100) Subject: (well-known url) add change-password X-Git-Tag: v1.2.0-rc.1~94 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=314141279db4826bf4862576b7e0df104834ad00;p=github%2FChocobozzz%2FPeerTube.git (well-known url) add change-password --- diff --git a/server/controllers/static.ts b/server/controllers/static.ts index 55e7392a1..4fd58f70c 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts @@ -136,6 +136,12 @@ staticRouter.use('/.well-known/dnt/', } ) +staticRouter.use('/.well-known/change-password', + (_, res: express.Response) => { + res.redirect('/my-account/settings') + } +) + // --------------------------------------------------------------------------- export { diff --git a/server/tests/misc-endpoints.ts b/server/tests/misc-endpoints.ts index b53803ee1..4de47d693 100644 --- a/server/tests/misc-endpoints.ts +++ b/server/tests/misc-endpoints.ts @@ -72,6 +72,16 @@ describe('Test misc endpoints', function () { expect(res.body.tracking).to.equal('N') }) + + it('Should get change-password location', async function () { + const res = await makeGetRequest({ + url: server.url, + path: '/.well-known/change-password', + statusCodeExpected: 302 + }) + + expect(res.header.location).to.equal('/my-account/settings') + }) }) describe('Test classic static endpoints', function () {