| | | 1 | | using ArturRios.Util.Random; |
| | | 2 | | |
| | | 3 | | namespace ArturRios.Heimdall.Command.Services; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// A fresh single-use token: 48 letters and digits from a CSPRNG, URL-safe — the same shape |
| | | 7 | | /// <see cref="EmailVerificationService" /> and <see cref="PasswordResetService" /> issue. Stored only |
| | | 8 | | /// through <see cref="SingleUseTokenHash" />. |
| | | 9 | | /// </summary> |
| | | 10 | | public static class SingleUseToken |
| | | 11 | | { |
| | 76 | 12 | | public static string New() => CustomRandom.Text(new RandomStringOptions |
| | 76 | 13 | | { |
| | 76 | 14 | | Length = 48, |
| | 76 | 15 | | IncludeLowercase = true, |
| | 76 | 16 | | IncludeUppercase = true, |
| | 76 | 17 | | IncludeDigits = true, |
| | 76 | 18 | | IncludeSpecialCharacters = false |
| | 76 | 19 | | }); |
| | | 20 | | } |