- Preparing search index...
- The search index is not available
git-essentials
Type alias AuthFailureCallback
Auth
Failure
Callback
: ((url
: string, auth
: Auth) => Auth | void | Promise<Auth | void>)
Type declaration
-
- (url: string, auth: Auth): Auth | void | Promise<Auth | void>
-
Returns Auth | void | Promise<Auth | void>
The callback is called when credentials fail. This is helpful to know if you were using a saved password in the AuthCallback, then you may want to offer the user the option to delete the currently saved password. It also gives you an opportunity to retry the request with new credentials.
As long as the callback function returns credentials, it will keep trying. This is the main reason we don't re-use the AuthCallback for this purpose. If we did, then a naive AuthCallback that simply returned saved credentials might loop indefinitely.
Example