public string GenerateAccessToken(string email, int minutes = 60)
        {
            JwtPayloadModel payload = new JwtPayloadModel
            {
                email = email,
                exp   = DateTime.UtcNow.AddMinutes(minutes)
            };

            return(JWT.Encode(payload, this._secretKey, JwsAlgorithm.HS256));
        }
        public Member verifyAccessToken(string token)
        {
            try
            {
                JwtPayloadModel payload = JWT.Decode <JwtPayloadModel>(token, this._secretKey);

                if (payload == null)
                {
                    return(null);
                }
                if (payload.exp < DateTime.UtcNow)
                {
                    return(null);
                }

                return(this._db.Members.SingleOrDefault(m => m.email.Equals(payload.email)));
            }
            catch
            {
                return(null);
            }
        }