Browse Source

Added check to make sure token is unique

master
Teknikode 6 months ago
parent
commit
ba8c0bb1b1
  1. 4
      IdentityServer/Controllers/ManageController.cs

4
IdentityServer/Controllers/ManageController.cs

@ -756,6 +756,10 @@ namespace Teknik.IdentityServer.Controllers @@ -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