public async Task <string> GetApiAuthToken() { CheckIT.API.Models.User user = await _auth.GetUser(this.User.Identity.Name); string token = user.ApiAuthToken; return(token); }
public async Task <string> GetRealmID() { CheckIT.API.Models.User user = await _auth.GetUser(this.User.Identity.Name); string token = user.realmID; return(token); }
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")); }
public async Task <CheckIT.API.Models.User> GetCurrentUser() { CheckIT.API.Models.User user = await _auth.GetUser(this.User.Identity.Name); return(user); }