Skip to content

Commit

Permalink
fix: handling of host, origin and path
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Jan 27, 2024
1 parent d091f69 commit 78c8e42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ const CoCreateUser = {
method: 'forgotPassword',
email,
from,
domain
origin,
hostname,
path
}

Crud.socket.send(request).then((response) => {
Expand All @@ -263,8 +265,7 @@ const CoCreateUser = {

resetPassword: async function (action) {
let data = {
method: 'resetPassword',
token
method: 'resetPassword'
}
let email = action.form.querySelector('input[key="email"]');
if (email)
Expand All @@ -282,7 +283,6 @@ const CoCreateUser = {
else return

Crud.socket.send(data).then((data) => {
console.log('reset password', response)
if (data.success)
document.dispatchEvent(new CustomEvent('resetPassword'));
else
Expand Down
4 changes: 2 additions & 2 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ class CoCreateUser {
<p>We received a request to reset the password for your account. If you did not make this request, please ignore this email. Otherwise, you can reset your password using the link below.</p>
<p><a href="${data.origin}/${data.path}?token=${recoveryId}" style="color: #ffffff; background-color: #007bff; padding: 10px 20px; text-decoration: none; border-radius: 5px;">Reset My Password</a></p>
<p><a href="${data.origin}/${data.path}?email=${data.email}&token=${recoveryId}&recoveyId=${recoveryId}" style="color: #ffffff; background-color: #007bff; padding: 10px 20px; text-decoration: none; border-radius: 5px;">Reset My Password</a></p>
<p>This link will expire in 24 hours for your security.</p>
<p>If you're having trouble with the button above, copy and paste the URL below into your web browser:</p>
<p><a href="${data.origin}/${data.path}?token=${recoveryId}">${data.origin}/${data.path}?token=${recoveryId}</a></p>
<p><a href="${data.origin}/${data.path}?email=${data.email}&token=${recoveryId}&recoveyId=${recoveryId}"">${data.origin}/${data.path}?email=${data.email}&token=${recoveryId}&recoveyId=${recoveryId}"</a></p>
<p>Need more help? Our support team is here for you. Contact us at <a href="mailto:support@${data.hostname}">support@${data.hostname}</a>.</p>
Expand Down

0 comments on commit 78c8e42

Please sign in to comment.