Exemple #1
0
 public admin VerifyAccessToken_back(JWTPayload payload)
 {
     try
     {
         test_db db = new test_db();
         if (payload == null)
         {
             return(null);
         }
         if (payload.exp < DateTime.UtcNow)
         {
             return(null);
         }
         var res = db.admins.FirstOrDefault(e => e.ad_username.Equals(payload.username));
         return(res);
     }
     catch { return(null); }
 }
Exemple #2
0
 public member VerifyAccessToken_main(JWTPayload payload)
 {
     try
     {
         test_db db = new test_db();
         if (payload == null)
         {
             return(null);
         }
         if (payload.exp < DateTime.UtcNow)
         {
             return(null);
         }
         var res = db.members.FirstOrDefault(e => e.mem_usename.Equals(payload.username));
         return(res);
     }
     catch { return(null); }
 }