SHARE
TWEET

Untitled

a guest Feb 16th, 2019 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using (UnitOfWork unitOfWork = new UnitOfWork(_context))
  2.             {
  3.                 if (model.Username == "Admin" && model.Password == "ChangeMe")
  4.                 {
  5.                     return Ok(_jwtHelper.GenerateJwtToken("Admin"));
  6.                 }
  7.                 else(model.Username != "Admin")
  8.                 {
  9.                     Utilizador utilizador = unitOfWork.Utilizadores.Login(model.Username, _passwordHasher.GetHashString(model.Password));
  10.  
  11.                     if (utilizador != null)
  12.                     {
  13.                         return Ok(_jwtHelper.GenerateJwtToken(utilizador.Username));
  14.                     }
  15.                 }
  16.             }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top