Browse Source

Removed unneeded config passthrough

master
Teknikode 6 years ago
parent
commit
a40b5804fb
  1. 6
      Teknik/Areas/API/Controllers/APIv1Controller.cs
  2. 2
      Teknik/Areas/User/Utility/UserHelper.cs

6
Teknik/Areas/API/Controllers/APIv1Controller.cs

@ -122,7 +122,7 @@ namespace Teknik.Areas.API.Controllers @@ -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 @@ -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 @@ -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;

2
Teknik/Areas/User/Utility/UserHelper.cs

@ -228,7 +228,7 @@ namespace Teknik.Areas.Users.Utility @@ -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