-
Notifications
You must be signed in to change notification settings - Fork 11
/
PasswordlessEndpointOptions.cs
51 lines (42 loc) · 1.39 KB
/
PasswordlessEndpointOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.Diagnostics;
using System.Text;
namespace Passwordless.AspNetCore;
/// <summary>
///
/// </summary>
[DebuggerDisplay("{DebuggerToString(),nq}")]
public class PasswordlessEndpointOptions(bool enableRegisterEndpoint = false)
{
/// <summary>
///
/// </summary>
public string GroupPrefix { get; set; } = string.Empty;
/// <summary>
///
/// </summary>
public string? RegisterPath { get; set; } = enableRegisterEndpoint ? "/passwordless-register" : null;
/// <summary>
///
/// </summary>
public string? LoginPath { get; set; } = "/passwordless-login";
/// <summary>
///
/// </summary>
public string? AddCredentialPath { get; set; } = "/passwordless-add-credential";
private string DebuggerToString()
{
var sb = new StringBuilder();
sb.Append($"{nameof(GroupPrefix)} = ");
sb.Append(GroupPrefix);
sb.Append(", ");
sb.Append($"{nameof(RegisterPath)}");
sb.Append(string.IsNullOrEmpty(RegisterPath) ? "(disabled)" : RegisterPath);
sb.Append(", ");
sb.Append($"{nameof(LoginPath)}");
sb.Append(string.IsNullOrEmpty(LoginPath) ? "(disabled)" : LoginPath);
sb.Append(", ");
sb.Append($"{nameof(AddCredentialPath)}");
sb.Append(string.IsNullOrEmpty(AddCredentialPath) ? "(disabled)" : AddCredentialPath);
return sb.ToString();
}
}