Proton Drive CLI API Documentation - v0.1.2
    Preparing search index...

    Class AuthService

    Main authentication service Handles login, session management, and token refresh

    Index

    Constructors

    Properties

    authApi: AuthApiClient

    Methods

    • Get current session or throw error if not authenticated

      Returns Promise<SessionCredentials>

      Current session credentials

    • Check if user is currently authenticated

      Returns Promise<boolean>

      True if authenticated

    • Check if a JWT token is expiring soon (within 5 minutes)

      Parameters

      • token: string

      Returns boolean

    • Authenticate with username and password using SRP protocol. Single attempt — no automatic retries. Rate-limit and CAPTCHA errors are surfaced to the caller so the user controls when to retry.

      Parameters

      • username: string
      • password: string
      • OptionalcaptchaToken: string

      Returns Promise<SessionCredentials>

    • Logout and clear the current session

      Returns Promise<void>

    • Refresh the access token using the refresh token

      Returns Promise<SessionCredentials>

      Updated session credentials