Beispiel #1
0
        public static async Task <bool> HasActiveSession(User user)
        {
            UserSession?match = await UserSessionModel.Find(user);

            if (match == null)
            {
                return(false);
            }

            if (DateTime.Now.Subtract(match.RefreshedAt) > TimeSpan.FromDays(7))
            {
                return(false);
            }

            return(true);
        }
Beispiel #2
0
 public static async Task <UserSession?> FindSession(string token)
 {
     return(await UserSessionModel.Find(token));
 }