-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement forgotten password funcitonality (#324)
* forgot password and reset forgotten password * included APP_URL_LOCAL in .env file * throw Exceptions on error * new providers into the tests * replaced exception with logger and increase jwt time of expiration * conditional on the value of APP_ENV * renamed functions * renamed functions * template change requested * renamed as requested * exception message * test errors * test errors * throw error instead logger
- Loading branch information
1 parent
ff9f1e7
commit 7bf1f2a
Showing
15 changed files
with
301 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"subject": "Забравена парола за Подкрепи.бг" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<mjml> | ||
<mj-body background-color="#ffffff" font-size="13px"> | ||
<mj-section | ||
background-color="#009FE3" | ||
vertical-align="top" | ||
padding-bottom="0px" | ||
padding-top="0"> | ||
</mj-section> | ||
<mj-section background-color="#009fe3" padding-bottom="20px" padding-top="20px"> | ||
<mj-column vertical-align="middle" width="100%"> | ||
<mj-text | ||
align="left" | ||
color="#ffffff" | ||
font-size="22px" | ||
font-family="open Sans Helvetica, Arial, sans-serif" | ||
padding-left="25px" | ||
padding-right="25px"> | ||
<span style="color: #feeb35"> Здравейте {{firstName}} {{lastName}}, </span> | ||
<br /><br /> | ||
</mj-text> | ||
<mj-text | ||
align="left" | ||
color="#ffffff" | ||
font-size="15px" | ||
font-family="open Sans Helvetica, Arial, sans-serif" | ||
padding-left="25px" | ||
padding-right="25px"> | ||
някой (може би Вие) е пуснал заявка за смяна на парола за достъп до Подкрепи.бг.<br /><br /> | ||
Ако не сте пускали подобна заявка, не е необходимо да правите нищо.<br /><br /> | ||
Ако Вие сте поискали възстановяване на паролата, натиснете бутона „Нова парола“.<br /><br /> | ||
</mj-text> | ||
<mj-button | ||
align="center" | ||
font-size="18px" | ||
background-color="#20c5a0" | ||
border-radius="8px" | ||
color="#fff" | ||
font-family="open Sans Helvetica, Arial, sans-serif" | ||
href="{{link}}" | ||
>Нова парола | ||
</mj-button> | ||
<mj-text | ||
align="left" | ||
color="#ffffff" | ||
font-size="15px" | ||
font-family="open Sans Helvetica, Arial, sans-serif" | ||
padding-left="25px" | ||
padding-right="25px"> | ||
Поздрави, <br /> | ||
Екипът на Подкрепи.бг | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
</mj-body> | ||
</mjml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ApiProperty } from '@nestjs/swagger' | ||
import { Expose } from 'class-transformer' | ||
import { IsEmail, IsNotEmpty } from 'class-validator' | ||
|
||
export class ForgottenPasswordEmailDto { | ||
@ApiProperty() | ||
@Expose() | ||
@IsNotEmpty() | ||
@IsEmail() | ||
public readonly email: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ApiProperty } from '@nestjs/swagger' | ||
import { Expose } from 'class-transformer' | ||
import { IsJWT, IsNotEmpty, IsString } from 'class-validator' | ||
|
||
export class NewPasswordDto { | ||
@ApiProperty() | ||
@Expose() | ||
@IsNotEmpty() | ||
@IsJWT() | ||
public readonly token: string | ||
|
||
@ApiProperty() | ||
@Expose() | ||
@IsNotEmpty() | ||
@IsString() | ||
public readonly password: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
7bf1f2a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage report
Test suite run success
172 tests passing in 62 suites.
Report generated by 🧪jest coverage report action from 7bf1f2a
7bf1f2a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage report
Test suite run success
172 tests passing in 62 suites.
Report generated by 🧪jest coverage report action from 7bf1f2a