dduan / Just

Swift HTTP for Humans
MIT License
1.4k stars 134 forks source link

Authentication is not happening in swift 4 #102

Closed goribchat closed 6 years ago

goribchat commented 6 years ago

This is my response message. here is my code let params = ["username" : email, "password": password] as [String : Any]

    print("type ::\(params)")

    Just.post(Constant.url.login1,params: params) { (r) in
        if !r.ok {
            print(r.text!)

        }
        else{

            let json = r.text!
            print(json)
            let login = Mapper<UserRoot>().map(JSONString: json)
            let errorValue = login?.success
            self.userDetails1 =  login?.details
            DispatchQueue.main.async {
                if errorValue == true {
                    self.userDetails1.backup = self.passwordTF.text!
                    self.passwordTF.text = ""
                }
                else if errorValue == false {

                }
            }
        }
    but after giving proper login credentials it is showing that username password is wrong. please help..
goribchat commented 6 years ago

Problem has been solved..