Streamlined grpc auth
Added ShareX Destiation on client
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
using AobaServer.Models;
|
||||
|
||||
using Grpc.Core;
|
||||
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
using MongoDB.Bson;
|
||||
@@ -37,4 +39,9 @@ public static class Extensions
|
||||
{
|
||||
return user.FindFirstValue(ClaimTypes.NameIdentifier).ToObjectId();
|
||||
}
|
||||
|
||||
public static ObjectId GetUserId(this ServerCallContext context)
|
||||
{
|
||||
return context.GetHttpContext().User.GetId();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user