mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Removed unneeded config passthrough
This commit is contained in:
parent
b3b0277582
commit
a40b5804fb
@ -122,7 +122,7 @@ namespace Teknik.Areas.API.Controllers
|
||||
// Associate this with the user if they provided an auth key
|
||||
if (!string.IsNullOrEmpty(model.authToken))
|
||||
{
|
||||
User foundUser = UserHelper.GetUserFromToken(db, Config, model.authToken);
|
||||
User foundUser = UserHelper.GetUserFromToken(db, model.authToken);
|
||||
if (foundUser != null)
|
||||
{
|
||||
upload.UserId = foundUser.UserId;
|
||||
@ -186,7 +186,7 @@ namespace Teknik.Areas.API.Controllers
|
||||
// Associate this with the user if they provided an auth key
|
||||
if (!string.IsNullOrEmpty(model.authToken))
|
||||
{
|
||||
User foundUser = UserHelper.GetUserFromToken(db, Config, model.authToken);
|
||||
User foundUser = UserHelper.GetUserFromToken(db, model.authToken);
|
||||
if (foundUser != null)
|
||||
{
|
||||
paste.UserId = foundUser.UserId;
|
||||
@ -231,7 +231,7 @@ namespace Teknik.Areas.API.Controllers
|
||||
// Associate this with the user if they provided an auth key
|
||||
if (!string.IsNullOrEmpty(model.authToken))
|
||||
{
|
||||
User foundUser = UserHelper.GetUserFromToken(db, Config, model.authToken);
|
||||
User foundUser = UserHelper.GetUserFromToken(db, model.authToken);
|
||||
if (foundUser != null)
|
||||
{
|
||||
newUrl.UserId = foundUser.UserId;
|
||||
|
@ -228,7 +228,7 @@ namespace Teknik.Areas.Users.Utility
|
||||
return user;
|
||||
}
|
||||
|
||||
public static User GetUserFromToken(TeknikEntities db, Config config, string token)
|
||||
public static User GetUserFromToken(TeknikEntities db, string token)
|
||||
{
|
||||
string hashedToken = SHA256.Hash(token);
|
||||
User foundUser = db.Users.FirstOrDefault(u => u.AuthTokens.Select(a => a.HashedToken).Contains(hashedToken));
|
||||
|
Loading…
Reference in New Issue
Block a user