Commit 03266101 authored by Daniel Roth's avatar Daniel Roth
Browse files

Fix incorrect claims type

parent 341173d3
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -36,7 +37,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
......@@ -89,7 +90,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
private static async Task TrackAndSendNotificationsAsync(Order order, NotificationSubscription subscription)
......
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -36,7 +37,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
......@@ -89,7 +90,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
private static async Task TrackAndSendNotificationsAsync(Order order, NotificationSubscription subscription)
......
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -36,7 +37,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
......@@ -89,7 +90,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
private static async Task TrackAndSendNotificationsAsync(Order order, NotificationSubscription subscription)
......
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -36,7 +37,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
......@@ -89,7 +90,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
private static async Task TrackAndSendNotificationsAsync(Order order, NotificationSubscription subscription)
......
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -36,7 +37,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
......@@ -89,7 +90,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
private static async Task TrackAndSendNotificationsAsync(Order order, NotificationSubscription subscription)
......
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -36,7 +37,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
......@@ -89,7 +90,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
private static async Task TrackAndSendNotificationsAsync(Order order, NotificationSubscription subscription)
......
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -36,7 +37,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -90,7 +91,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
private static async Task TrackAndSendNotificationsAsync(Order order, NotificationSubscription subscription)
......
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -36,7 +37,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -90,7 +91,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
private static async Task TrackAndSendNotificationsAsync(Order order, NotificationSubscription subscription)
......
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -36,7 +37,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -90,7 +91,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
private static async Task TrackAndSendNotificationsAsync(Order order, NotificationSubscription subscription)
......
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
......@@ -36,7 +37,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
......@@ -92,7 +93,7 @@ namespace BlazingPizza.Server
private string GetUserId()
{
return HttpContext.User.FindFirst("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value;
return HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
}
private static async Task TrackAndSendNotificationsAsync(Order order, NotificationSubscription subscription)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment