auth.checkRecoveryPassword
Check if the 2FA recovery code sent using auth.requestPasswordRecovery is valid, before passing it to auth.recoverPassword.
func (c *Client) AuthCheckRecoveryPassword(ctx context.Context, code string) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AuthCheckRecoveryPassword(ctx, code)
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Code | string | yes | Code received via email |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CODE_EMPTY | The provided code is empty. |
| 400 | PASSWORD_RECOVERY_EXPIRED | The recovery code has expired. |
References
- Official documentation
- Generated Go reference
- TL definition:
auth.checkRecoveryPassword#d36bf79