mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Added check to make sure token is unique
This commit is contained in:
parent
73ae766db5
commit
ba8c0bb1b1
@ -756,6 +756,10 @@ namespace Teknik.IdentityServer.Controllers
|
|||||||
{
|
{
|
||||||
// Generate a unique token
|
// Generate a unique token
|
||||||
var token = StringHelper.RandomString(40, "abcdefghjkmnpqrstuvwxyz1234567890");
|
var token = StringHelper.RandomString(40, "abcdefghjkmnpqrstuvwxyz1234567890");
|
||||||
|
while (dbContext.AuthTokens.FirstOrDefault(t => t.Token == token) != null)
|
||||||
|
{
|
||||||
|
token = StringHelper.RandomString(40, "abcdefghjkmnpqrstuvwxyz1234567890");
|
||||||
|
}
|
||||||
var authToken = new AuthToken()
|
var authToken = new AuthToken()
|
||||||
{
|
{
|
||||||
AuthTokenId = Guid.NewGuid(),
|
AuthTokenId = Guid.NewGuid(),
|
||||||
|
Loading…
Reference in New Issue
Block a user