解析斯威夫特登录错误:用户身份凭证无效 [英] Parse Swift Login Error: Invalid User Credentials

查看:522
本文介绍了解析斯威夫特登录错误:用户身份凭证无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图登录与MYNAME /为mypass的现有用户/密码来分析,但我不断收到错误code 101,无效的登录凭据。

I am trying to log in to Parse with an existing user/password of myname/mypass but I keep getting Error Code 101, Invalid Login Credentials.

我知道MYNAME /为mypass的作品,因为我能够使用注册函数来创建这个用户,并进入应用程序如常。我也能看到解析Web界面上该用户的存在。

I know myname/mypass works because I was able to use the signUp function to create this user and get into the app as usual. I am also able to see the existence of this user on the Parse web interface.

我试图从文本字段拉动用户名/密码,并在硬编码MYNAME/为mypass。一切都产生相同的。

I have tried pulling username/password from text fields and also hardcoding in "myname"/"mypass". Everything yields the same.

 @IBAction func loginButtonTapped(sender: AnyObject) {
        println(userNameTextField.text) //correctly prints the string.
        println(passwordTextField.text) //correctly prints the string.
        PFUser.logInWithUsernameInBackground(userNameTextField.text, password:passwordTextField.text) {
            (user: PFUser?, error: NSError?) -> Void in
            if user != nil {
                var currentUser = PFUser.currentuser()
                println("log in succesful") // this does not print.
                performSegueWithIdentifier("SegueToHomeScreen", self) // this does not happen
            } else {
                // The login failed. Check error to see why.
            }
        }

我知道这是类似于在这么几个其他问题,但那些一直无人接听。任何帮助将是AP preciated。

I know this is similar to a few other questions on SO, but those have been unanswered. Any help would be appreciated.

推荐答案

唉,我觉得自己像个白痴。我要感谢别人对自己的建议,当它其实这是我自己的失败。

Ugh, I feel like an idiot. I'd like to thank the others for their suggestions, when it fact it was my own failure.

我是(可耻)的硬编码密码作为一个字符串MYPASSWORD在注册过程中,所以我想我签署了密码通行证和MYPASSWORD被发送。我并没有专注于signUpViewController,因为这是工作的罚款。

I was (shamefully) hardcoding the password as a string "myPassword" during signUp, so I thought I was signing up with password "pass" and "myPassword" was being sent. I didn't focus on the signUpViewController since it was working fine.

不要像我一样。你再往前走之前,请确保您设置您的用户名,并通过如预期在你的注册。

Don't be like me. Before you go any further, make sure you are setting your username and pass as intended in your signUp.

这篇关于解析斯威夫特登录错误:用户身份凭证无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆