0

How can I make Alamofire(swift-ios) and Deployd accept third parameter (property) i.e., an email? It's working fine but I need to add an email textfield too.

Swift code:

    let user = "root"
    let password = "root"
    //let email = "root@root.com" (the third parameter)

    let credential = NSURLCredential(user: user, password: password, persistence: .ForSession)

    let parameters = ["username" : user, "password" : password]
    Alamofire.request(.POST, "http://localhost:2403/users", parameters: parameters)
        .authenticate(usingCredential: credential)
        .response { request, response, _, error in  }

from deployd's docs:

//Create a user
dpd.users.post({
  username: "jeffbcross",
  password: "secret"
}, onCreateUser);

Add custom properties and roles to your users, and write custom Event scripts to control access to users of your app.

I really have no idea about how can I write a custom Event script. I don't really know any language other than Swift. I've already created 'email' property at users from dashboard but it's not taken into effect.

halfer
  • 19,824
  • 17
  • 99
  • 186
Codetard
  • 2,441
  • 28
  • 34
  • Do you need this email parameter for authentication purposes? I'm not as familiar with Deployd but you should just be able to add "email" as another key in the parameters send to Alamofire. – Tyler Aug 07 '15 at 18:30
  • 2
    I've already created 'email' property at users from dashboard but it's not taken into effect. – Codetard Aug 07 '15 at 18:32
  • 2
    Yes, i do need email parameter for authentication purposes. – Codetard Aug 07 '15 at 18:33

0 Answers0