user-service
    Preparing search index...

    Service interface for handling authentication and authorization.

    interface AuthService {
        login(username: string, password: string): Promise<RefreshResponse>;
        logout(username: string): Promise<void>;
        refresh(token: string): Promise<RefreshResponse>;
        verify(token: string): Promise<AccessTokenPayload | undefined>;
    }

    Implemented by

    Index

    Methods

    • Authenticates a user with their credentials and issues an access token.

      Parameters

      • username: string

        The username of the user attempting to log in.

      • password: string

        The password of the user.

      Returns Promise<RefreshResponse>

      A promise that resolves to a new access token if authentication succeeds.

    • Logs a user out of the system

      Parameters

      • username: string

        The username of the user logging out.

      Returns Promise<void>

      A promise that resolves once the logout process is complete.

    • Validates an access token and extracts its payload.

      Parameters

      • token: string

        The JWT to validate.

      Returns Promise<AccessTokenPayload | undefined>

      A promise that resolves with the decoded payload if valid, or null if the token is invalid or expired.