コード例 #1
0
        public async Task<IActionResult> TokenAsync(LoginModel login, bool init = false)
        {
            var user = !init ? _auth.Validate(login.Username, login.Password) : new Vic.Data.Entities.User() { Username = login.Username };

            return new JsonResult(await _auth.AuthenticateAsync(user));
        }