Skip to content

Add hints to RegisterOptions #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/Passwordless/Models/RegisterOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,34 @@ public record RegisterOptions(string UserId, string Username)
public bool? Discoverable { get; init; }

/// <summary>
/// Allows choosing preference for requiring User Verification
/// (biometrics, pin code etc) when authenticating Can be "preferred" (default), "required" or "discouraged".
/// Allows choosing preference for requiring User Verification (biometrics, pin code etc) when authenticating.
/// Can be "preferred" (default), "required" or "discouraged".
/// </summary>
public string? UserVerification { get; init; }

/// <summary>
/// Timestamp (UTC) when the registration token should expire. By default, current time + 120 seconds.
/// Timestamp (UTC) when the registration token should expire.
/// By default, current time + 120 seconds.
/// </summary>
public DateTime? ExpiresAt { get; init; }

/// <summary>
/// A array of aliases for the userId, such as an email or username. Used to initiate a
/// An array of aliases for the userId, such as an email or username. Used to initiate a
/// signin on the client side with the signinWithAlias() method. An alias must be unique to the userId.
/// Defaults to an empty array [].
/// </summary>
public HashSet<string> Aliases { get; init; } = [];

/// <summary>
/// Whether aliases should be hashed before being stored. Defaults to true.
/// Whether aliases should be hashed before being stored.
/// Defaults to true.
/// </summary>
public bool? AliasHashing { get; init; }

/// <summary>
/// Hints used to communicate to the user agent about how the request may be best completed.
/// Can be "security-key", "client-device", "hybrid".
/// Defaults to an empty array [].
/// </summary>
public IReadOnlyList<string> Hints { get; init; } = [];
}
Loading