Class AuthService

AuthService class

Constructors

Properties

sign: (data: any, exp?: string) => string

This function signs a token

Type declaration

    • (data: any, exp?: string): string
    • Parameters

      • data: any

        The data to sign

      • Optionalexp: string

        The expiration date of the token

      Returns string

      The signed token

signCustom: (data: any, secret: string, exp?: string) => string

This function signs the token with a custom secret

Type declaration

    • (data: any, secret: string, exp?: string): string
    • Parameters

      • data: any

        The data to sign

      • secret: string

        The secret to sign the token with

      • Optionalexp: string

        The expiration date of the token

      Returns string

      The signed token

verify: (token: string, path: string) => any

This function verifies a token

Type declaration

    • (token: string, path: string): any
    • Parameters

      • token: string

        The token to verify

      • path: string

        The path/procedure of the request to verify the token for

      Returns any

      The decoded token

verifyCustom: (token: string, secret: string) => any

This function verifies a token with custom jwt secret

Type declaration

    • (token: string, secret: string): any
    • Parameters

      • token: string

        The token to verify

      • secret: string

      Returns any

      The decoded token