Browse Source

Added check to make sure token is unique

master
Teknikode 1 month ago
parent
commit
ba8c0bb1b1
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      IdentityServer/Controllers/ManageController.cs

+ 4
- 0
IdentityServer/Controllers/ManageController.cs View File

@@ -756,6 +756,10 @@ namespace Teknik.IdentityServer.Controllers
{
// Generate a unique token
var token = StringHelper.RandomString(40, "abcdefghjkmnpqrstuvwxyz1234567890");
while (dbContext.AuthTokens.FirstOrDefault(t => t.Token == token) != null)
{
token = StringHelper.RandomString(40, "abcdefghjkmnpqrstuvwxyz1234567890");
}
var authToken = new AuthToken()
{
AuthTokenId = Guid.NewGuid(),

Loading…
Cancel
Save