public async Task <HttpResponseMessage> LoginTonkenAsync(UserCredentials userCredentials)
        {
            try
            {
                var userToLogin = Mapper.Map <KorisnikViewModel>(await korisnikService.FindByUserNameAsync(userCredentials.Korisnicko_ime));

                if (userToLogin == null)
                {
                    return(Request.CreateResponse(HttpStatusCode.NotFound, "Korisnik nije registriran"));
                }
                else if (userCredentials.Lozinka != userToLogin.Lozinka)
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest, "Password is incorect"));
                }
                else
                {
                    var tokenDuration = DateTime.UtcNow.AddMinutes(10);//POSTAVLJANJE VREMENA
                    var token         = new TokenFactory(tokenDuration).GenerateToken();
                    var tokenResponse = new TokenResponse()
                    {
                        KorisnikId     = userToLogin.Id,
                        Korisnicko_ime = userCredentials.Korisnicko_ime,
                        Token          = token,
                        Uloga          = userToLogin.Uloga,
                    };

                    return(Request.CreateResponse(HttpStatusCode.OK, tokenResponse));
                }
            }
            catch (Exception e)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.Unauthorized, e));
            }
        }