Creates an instance of the SecureAuthService.
Instance of the PrismaService to interact with the database.
Instance of the ConfigService to access the authentication configuration.
Instance of the JwtService to sign and verify JWT tokens.
Instance of the MailService to send emails.
Private
Readonly
configInstance of the ConfigService to access the authentication configuration.
Private
Readonly
emailConfiguration object for the email transporter used for sending emails.
Authentication credentials for the email server.
The password used for authenticating with the email server.
The username used for authenticating with the email server.
The hostname of the email server.
The port number of the email server.
A boolean indicating if the connection to the email server should use SSL/TLS.
The email address of the sender.
Private
Readonly
forgotConfiguration object for the "Forgot Password" functionality.
The expiration time (in milliseconds) for the reset token.
The URL where users will be redirected to reset their password.
Private
Readonly
jwtInstance of the JwtService to sign and verify JWT tokens.
Private
Readonly
mailInstance of the MailService to send emails.
Private
prismaInstance of the PrismaService to interact with the database.
Private
transporterNodemailer transporter used to send emails.
Private
createFinds or creates a user based on the provided OAuth profile.
The OAuth profile of the user.
Initiates the "Forgot Password" flow for a user based on the provided email.
The email of the user.
Authenticates a user based on their email and password and returns an access token upon successful authentication.
The email of the user.
The password of the user.
Resets the password of a user based on the provided email and a new password.
The email of the user.
The new password for the user.
Sends a reset password email to the user with a reset URL.
The email of the user.
The URL where the user can reset their password.
Registers a new user with the provided email and password.
The email of the new user.
The password of the new user.
Stores the reset token and its expiration time in the user's database record.
The email of the user.
The reset token to store.
The expiration time of the reset token.
Validates the payload of a JWT token and retrieves the associated user from the database.
The decoded payload of the JWT token.
Generated using TypeDoc
Injectable service that provides authentication-related functionalities, such as login, signup, password reset, and token validation.
Name
SecureAuthService