From 91fc989eea5ee16c2f000064b5c040a6fe6f23b9 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Thu, 16 May 2019 01:10:10 +0200 Subject: Implement tokens --- DSACore/Models/Network/Token.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 DSACore/Models/Network/Token.cs (limited to 'DSACore/Models/Network') diff --git a/DSACore/Models/Network/Token.cs b/DSACore/Models/Network/Token.cs new file mode 100644 index 0000000..0021317 --- /dev/null +++ b/DSACore/Models/Network/Token.cs @@ -0,0 +1,21 @@ +using System; +using Microsoft.EntityFrameworkCore; + +namespace DSACore.Models.Network +{ + public class Token + { + public string Group { get; set; } + private DateTime creation = DateTime.Now; + + public Token(string @group) + { + Group = @group; + } + + public bool IsValid() + { + return DateTime.Now - creation < TimeSpan.FromMinutes(1); + } + } +} \ No newline at end of file -- cgit v1.2.3-70-g09d2