Gradebook Backend API Documentation - v0.0.1
    Preparing search index...

    Service responsible for authentication and user account management operations. Handles user registration, login, password reset, and email changes.

    Index

    Constructors

    Methods

    • Changes a user's email address and issues a new JWT token.

      Parameters

      • email: string

        Current email address of the user

      • newEmail: string

        New email address to change to

      Returns Promise<{ message: string; token: string }>

      A success message and new JWT token

      UnauthorizedException if the email change fails

    • Initiates the forgot password process by sending a reset link to the user's email.

      Parameters

      • email: string

        Email address of the user requesting password reset

      Returns Promise<{ message: string }>

      A success message indicating an email was sent

      UnauthorizedException if no user is found with the provided email

    • Authenticates a user and generates a JWT token.

      Parameters

      • email: string

        Email address of the user

      • password: string

        Password to verify

      Returns Promise<{ token: string }>

      A JWT token upon successful authentication

      UnauthorizedException if the credentials are invalid

    • Registers a new user in the system with the Student role.

      Parameters

      • email: string

        Email address of the user

      • firstName: string

        First name of the user

      • lastName: string

        Last name of the user

      • password: string

        Password for the account

      Returns Promise<{ message: string }>

      A success message upon successful registration

      BadRequestException if the email is already in use

      InternalServerErrorException if an unexpected error occurs

    • Resets a user's password using a token from the reset link.

      Parameters

      • token: string

        JWT token from the password reset email

      • password: string

        New password to set

      Returns Promise<{ message: string }>

      A success message upon password change

      UnauthorizedException if the token is invalid or expired