Type alias AuthSuccessCallback

AuthSuccessCallback: ((url: string, auth: Auth) => void | Promise<void>)

Type declaration

    • (url: string, auth: Auth): void | Promise<void>
    • The callback is called when credentials work. This is helpful to know if you want to offer to save the credentials, but only if they are valid.

      Example

      await clone({
      ...,
      onAuthSuccess: (url, auth) => {
      if (confirm('Remember password?')) {
      savePassword(url, auth)
      }
      }
      })

      Parameters

      • url: string
      • auth: Auth

      Returns void | Promise<void>

Generated using TypeDoc