public AccountResponse Login(string token) { var query = GetUriBuilder(ControllerPrefix + "/logintoken").ToString(); var payload = new TokenLoginRequest { TokenString = token }; return(Post <AccountResponse>(query, payload)); }
public IActionResult LoginToken([FromBody] TokenLoginRequest tokenLogin) { var tokenValues = _tokenController.ValidateToken(HttpContext, tokenLogin.TokenString); var userId = tokenValues.Item1; var gameId = tokenValues.Item2; var account = _accountCoreController.GetByUser(userId); var accountSourceToken = _accountSourceController.Get(account.AccountSourceId).Token; account = _accountCoreController.AuthenticateToken(account, accountSourceToken); var session = _sessionTracker.StartSession(gameId, userId); _tokenController.IssueSessionToken(HttpContext, session); var response = account.ToContract(); return(new ObjectResult(response)); }