Making the code a query string parameter for invite/reset urls.
This commit is contained in:
parent
2614027969
commit
c37f41fbd5
|
@ -30,7 +30,7 @@ describe("/api/admin/auth", () => {
|
||||||
expect(sendMailMock).toHaveBeenCalled()
|
expect(sendMailMock).toHaveBeenCalled()
|
||||||
const emailCall = sendMailMock.mock.calls[0][0]
|
const emailCall = sendMailMock.mock.calls[0][0]
|
||||||
// after this URL there should be a code
|
// after this URL there should be a code
|
||||||
const parts = emailCall.html.split("http://localhost:10000/reset/")
|
const parts = emailCall.html.split("http://localhost:10000/reset?code=")
|
||||||
code = parts[1].split("\"")[0]
|
code = parts[1].split("\"")[0]
|
||||||
expect(code).toBeDefined()
|
expect(code).toBeDefined()
|
||||||
})
|
})
|
||||||
|
|
|
@ -30,7 +30,7 @@ describe("/api/admin/users", () => {
|
||||||
expect(sendMailMock).toHaveBeenCalled()
|
expect(sendMailMock).toHaveBeenCalled()
|
||||||
const emailCall = sendMailMock.mock.calls[0][0]
|
const emailCall = sendMailMock.mock.calls[0][0]
|
||||||
// after this URL there should be a code
|
// after this URL there should be a code
|
||||||
const parts = emailCall.html.split("http://localhost:10000/invite/")
|
const parts = emailCall.html.split("http://localhost:10000/invite?code=")
|
||||||
code = parts[1].split("\"")[0]
|
code = parts[1].split("\"")[0]
|
||||||
expect(code).toBeDefined()
|
expect(code).toBeDefined()
|
||||||
})
|
})
|
||||||
|
|
|
@ -35,13 +35,13 @@ exports.getSettingsTemplateContext = async (purpose, code = null) => {
|
||||||
case EmailTemplatePurpose.PASSWORD_RECOVERY:
|
case EmailTemplatePurpose.PASSWORD_RECOVERY:
|
||||||
context[TemplateBindings.RESET_CODE] = code
|
context[TemplateBindings.RESET_CODE] = code
|
||||||
context[TemplateBindings.RESET_URL] = checkSlashesInUrl(
|
context[TemplateBindings.RESET_URL] = checkSlashesInUrl(
|
||||||
`${URL}/reset/${code}`
|
`${URL}/reset?code=${code}`
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
case EmailTemplatePurpose.INVITATION:
|
case EmailTemplatePurpose.INVITATION:
|
||||||
context[TemplateBindings.INVITE_CODE] = code
|
context[TemplateBindings.INVITE_CODE] = code
|
||||||
context[TemplateBindings.REGISTRATION_URL] = checkSlashesInUrl(
|
context[TemplateBindings.REGISTRATION_URL] = checkSlashesInUrl(
|
||||||
`${URL}/invite/${code}`
|
`${URL}/invite?code=${code}`
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue