Skip to content

Commit 24942a9

Browse files
committed
Adds authentication check to loadProfile endpoint and updates Azure.Data.Tables package version
1 parent 9c04bca commit 24942a9

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/Clients/DevDad.SaaSAdmin.API/EndpointExtensions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ public static class EndpointExtensions
114114
async Task<IResult> (LoadProfileRequest requestData, HttpContext httpContext) =>
115115
{
116116
IResult result = Results.NoContent();
117+
var user = httpContext.User;
118+
119+
if(user.Identity?.IsAuthenticated??false == false)
120+
{
121+
logger.LogWarning("Unauthorized request to loadProfile endpoint.");
122+
return Results.Unauthorized();
123+
}
117124

118125
try
119126
{

src/ResourceAccess/DevDad.SaaSAdmin.UserAccountAccess.AzureTableProvider/DevDad.SaaSAdmin.UserAccountAccess.AzureTableProvider.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Azure.Data.Tables" Version="12.9.1" />
15+
<PackageReference Include="Azure.Data.Tables" Version="12.10.0" />
1616
</ItemGroup>
1717

1818
</Project>

src/Tests/TestConsole/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ static void Main(string[] args)
111111
static void TestHostedApi(ILogger logger)
112112
{
113113
string url = "https://tdmf-admin-api-f4a5caaydzgncqf4.eastus2-01.azurewebsites.net/loadProfile";
114+
//string url = "http://localhost:5083/loadProfile";
114115
string userId = "a0b66013-a5ef-462f-a812-3eb4aeacff66";
115116
var request = new
116117
{

0 commit comments

Comments
 (0)