update to API 5, consolidate hubs into one

This commit is contained in:
Stanley Dimant 2022-07-13 14:05:42 +02:00
parent 4a83a7dba0
commit a416521aab
21 changed files with 907 additions and 418 deletions

View file

@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Security.Claims;
using System.Security.Cryptography;
using System.Text;
@ -32,7 +30,8 @@ namespace MareSynchronosServer.Authentication
using var sha256 = SHA256.Create();
var hashedHeader = BitConverter.ToString(sha256.ComputeHash(Encoding.UTF8.GetBytes(authHeader))).Replace("-", "");
var uid = (await _mareDbContext.Users.AsNoTracking().FirstOrDefaultAsync(m => m.SecretKey == hashedHeader))?.UID;
var uid = (await _mareDbContext.Auth.Include("User").AsNoTracking()
.FirstOrDefaultAsync(m => m.HashedKey == hashedHeader))?.UserUID;
if (uid == null)
{