Class OneTimeCode
- Namespace
- Dynamicweb.Security.UserManagement
- Assembly
- Dynamicweb.Core.dll
Represents the functionality to work with one-time codes.
public sealed class OneTimeCode
- Inheritance
-
OneTimeCode
- Inherited Members
Properties
Code
The one-time code.
public string Code { get; }
Property Value
Expiration
The date and time when the code expires.
public DateTimeOffset Expiration { get; }
Property Value
Methods
Create()
Creates a new instance of the OneTimeCode generating a new code.
public static OneTimeCode Create()
Returns
- OneTimeCode
The instance of the OneTimeCode with randomly generated code.
EncryptCode()
public string EncryptCode()
Returns
ValidateCode(string)
Checks if the codeToVerify
is valid and not outdated.
public bool ValidateCode(string codeToVerify)
Parameters
Returns
- bool
True
if the code is valid and not outdated, otherwiseFalse
.