Example #1
0
        public async Task <string> GetApiAuthToken()
        {
            CheckIT.API.Models.User user = await _auth.GetUser(this.User.Identity.Name);

            string token = user.ApiAuthToken;

            return(token);
        }
Example #2
0
        public async Task <string> GetRealmID()
        {
            CheckIT.API.Models.User user = await _auth.GetUser(this.User.Identity.Name);

            string token = user.realmID;

            return(token);
        }
Example #3
0
        public async Task <IActionResult> SetApiAuthToken(string token, string realmID)
        {
            CheckIT.API.Models.User user = await _auth.GetUser(this.User.Identity.Name);

            if (await _auth.SetApiAuthToken(user.Id, token, realmID))
            {
                return(StatusCode(201));
            }

            return(BadRequest("Could not find User"));
        }
Example #4
0
        public async Task <CheckIT.API.Models.User> GetCurrentUser()
        {
            CheckIT.API.Models.User user = await _auth.GetUser(this.User.Identity.Name);

            return(user);
        }