Skip to content
Snippets Groups Projects
Commit c69893db authored by L. Ellenbeck's avatar L. Ellenbeck
Browse files

WIP: fixed get token coscine/issues#1125

parent faa7f91f
No related branches found
No related tags found
1 merge request!100New: Add ApiToken Database Model
......@@ -11,6 +11,6 @@ using System.Reflection;
[assembly: AssemblyProduct("Database.T4")]
[assembly: AssemblyVersion("1.26.0")]
[assembly: AssemblyFileVersion("1.26.0")]
[assembly: AssemblyInformationalVersion("1.26.0-topic-1125-apito0001")]
[assembly: AssemblyInformationalVersion("1.26.0-topic-1125-apito0002")]
[assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")]
......@@ -11,6 +11,6 @@ using System.Reflection;
[assembly: AssemblyProduct("Database.Tests")]
[assembly: AssemblyVersion("1.26.0")]
[assembly: AssemblyFileVersion("1.26.0")]
[assembly: AssemblyInformationalVersion("1.26.0-topic-1125-apito0001")]
[assembly: AssemblyInformationalVersion("1.26.0-topic-1125-apito0002")]
[assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")]
......@@ -44,7 +44,11 @@ namespace Coscine.Database.Models
public ApiTokenObject GetToken(string userId, string token)
{
var t = GetWhere(x => x.Token.ToLower() == token.ToLower() && x.UserId.ToString() == userId);
var t = GetWhere(x => x.UserId.ToString() == userId && x.Token == token);
if(t == null)
{
return null;
}
return new ApiTokenObject { Created = t.Creation, Expires = t.Expiration, Token = t.Token, Description = t.Description };
}
......
......@@ -11,6 +11,6 @@ using System.Reflection;
[assembly: AssemblyProduct("Database")]
[assembly: AssemblyVersion("1.26.0")]
[assembly: AssemblyFileVersion("1.26.0")]
[assembly: AssemblyInformationalVersion("1.26.0-topic-1125-apito0001")]
[assembly: AssemblyInformationalVersion("1.26.0-topic-1125-apito0002")]
[assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment