Browse Source

Removed unneeded config passthrough

tags/2.0.6
Teknikode 3 years ago
parent
commit
a40b5804fb

+ 3
- 3
Teknik/Areas/API/Controllers/APIv1Controller.cs View File

@@ -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;

+ 1
- 1
Teknik/Areas/User/Utility/UserHelper.cs View File

@@ -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…
Cancel
Save