Implemented TokenManager #57

This commit is contained in:
kdeng00
2019-08-13 00:11:04 -04:00
parent da8d4a9002
commit f0a50ba70a
16 changed files with 176 additions and 241 deletions
+25 -9
View File
@@ -1,4 +1,5 @@
using System;
using System.Runtime.InteropServices;
using Newtonsoft.Json;
@@ -7,14 +8,29 @@ namespace Icarus.Models
public class LoginResult : BaseResult
{
[JsonProperty("id")]
public int UserId { get; set; }
[JsonProperty("username")]
public string Username { get; set; }
[JsonProperty("token")]
public string Token { get; set; }
[JsonProperty("token_type")]
public string TokenType { get; set; }
[JsonProperty("expiration")]
public int Expiration { get; set; }
public int UserId { get; set; }
[JsonProperty("username")]
public string Username { get; set; }
[JsonProperty("token")]
public string Token { get; set; }
[JsonProperty("token_type")]
public string TokenType { get; set; }
[JsonProperty("expiration")]
public int Expiration { get; set; }
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi), Serializable]
public struct LogRes
{
public int UserId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
public string Username;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
public string Token;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
public string TokenType;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
public string Message;
public int Expiration;
}
}