Beispiel #1
0
        public static User CheckAuth(TokenClass token)
        {
            User u = User.GetUserByUsername(token.Username);

            // todo handle error here or caller
            return(u);
        }
Beispiel #2
0
        protected Response CheckValid()
        {
            Response   resp  = new Response(true, "");
            TokenClass token = new TokenClass(username);

            User user = TokenClass.CheckAuth(token);

            if (user == null) // user not exist
            {
                resp = new Response(false, outputErrUnknownUser);

                return(resp);
            }

            username = user.UserName;

            return(resp);
        }