Skip to content

Commit 5e1cac0

Browse files
committed
refactor: 增加默认服务逻辑
1 parent 9f027cb commit 5e1cac0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/BootstrapBlazor/Services/DefaultTotpService.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ class DefaultTotpService : ITotpService
99
{
1010
public TotpInstanceBase Instance { get; } = new DefaultTotpInstance();
1111

12-
public string Compute(string secretKey, DateTime? timestamp = null) => "";
12+
public string Compute(string secretKey, DateTime? timestamp = null) => "123456";
1313

14-
public string GenerateOtpUri(OtpOptions? options = null) => "";
14+
public string GenerateOtpUri(OtpOptions? options = null) => "otpauth://totp/BootstrapBlazor?secret=OMM2LVLFX6QJHMYI&issuer=Simulator";
1515

16-
public string GenerateSecretKey(int length = 20) => "";
16+
public string GenerateSecretKey(int length = 20) => "OMM2LVLFX6QJHMYI";
1717

18-
public int GetRemainingSeconds(DateTime? timestamp = null) => 0;
18+
public int GetRemainingSeconds(DateTime? timestamp = null) => 30;
1919

2020
public byte[] GetSecretKeyBytes(string input) => [];
2121

2222
public bool Verify(string code, DateTime? timestamp = null) => false;
2323

2424
class DefaultTotpInstance : TotpInstanceBase
2525
{
26-
public override int GetRemainingSeconds(DateTime? timestamp = null) => 0;
26+
public override int GetRemainingSeconds(DateTime? timestamp = null) => 30;
2727

2828
public override bool Verify(string code, DateTime? timestamp = null) => false;
2929
}

0 commit comments

Comments
 (0)