Skip to main content

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​

NameTypeRequiredDescription
CodestringyesCode received via email

Returns​

bool

Possible errors​

CodeTypeDescription
400CODE_EMPTYThe provided code is empty.
400PASSWORD_RECOVERY_EXPIREDThe recovery code has expired.

References​