Exemplo n.º 1
0
        public async Task <IActionResult> Store([FromBody] SignInStoreViewModel viewModel)
        {
            var token = await _auth.Attempt(viewModel.Username, viewModel.Password);

            if (token == null)
            {
                return(Unauthorized());
            }

            return(Ok(token));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Store([FromBody] StoreSessionViewModel viewModel)
        {
            var token = await _auth.Attempt(viewModel.Email, viewModel.Password);

            if (token == null)
            {
                return(Unauthorized());
            }

            var response = new ResponseViewModel <string>(token);

            return(Ok(response));
        }