Skip to content
Snippets Groups Projects
Commit d53a5a59 authored by esantangelo's avatar esantangelo
Browse files

Merge branch 'develop' of https://gitlab.fing.edu.uy/rodrigo.sastre/tsi1-backend into develop

parents bc5a1a58 6ef7b733
No related branches found
No related tags found
1 merge request!31Develop
Pipeline #10417 passed
......@@ -482,5 +482,12 @@ namespace Tsi1.Api.Controllers
return Ok();
}
[AllowAnonymous]
[HttpGet("GetAllRefreshTokens")]
public async Task<IActionResult> GetAllRefreshTokens()
{
return Ok(_jwtAuthManager.GetRefreshTokens());
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
......@@ -17,5 +18,6 @@ namespace Tsi1.Api.Infrastructure
int GenerateVerificationCode(string username, DateTime now);
bool ValidateVerificationCode(string username, int code);
public void RemoveExpiredVerificationCodes(DateTime now);
public IEnumerable<RefreshToken> GetRefreshTokens();
}
}
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
......@@ -150,6 +151,11 @@ namespace Tsi1.Api.Infrastructure
}
}
public IEnumerable<RefreshToken> GetRefreshTokens()
{
return _usersRefreshTokens.Select(x => x.Value).ToList();
}
private static string GenerateRefreshTokenString()
{
var randomNumber = new byte[32];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment