-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Facebook Login error: "[Error]: this auth is already used" #313
Comments
So you logout, create an anonymous user (which is the second entry there) and then link it with facebook? You should handle that yourself. However I agree that if it returns 208, parse-server should not save invalid auth data in the unlinkable user. |
This looks like bug potentially related to some recent changes in anonymous users. @steven-supersolid do you mind taking a look? |
I can take a look next week but looks like the issue was opened before the changes in #341 were merged. @meilers would you mind clarifying the repro steps and version of parse-server this occurs in? I would like to narrow down the issue to Facebook login, anonymous login or Facebook linking. The error message seems to indicate this is an issue with linking though. If you post more of the authData screenshot then will be able to see if there is any anonymous authData, |
OK, if you think it's not related to your changes thats fine and we can do our own investigation. |
Since a good number of things have changes in the user/auth space, please re-open if you're still experiencing this with 2.1.2. |
Hi everyone ! So when I look at the log I can see that: [31merror�[39m: Error generating response. ParseError { code: 208, message: 'this auth is already used' } code=208, message=this auth is already used and that: 31merror�[39m: Error generating response. [TypeError: Cannot read property 'getSessionToken' of undefined] Do you know what I need to do to correct that ? |
can you post the content of your cloud function? As well as the logs printed in the console with VERBOSE=1 environment variable set when you start your server? |
This error appear for example, when I call the cloud function "participateIntoEvent": [31merror�[39m: Failed running cloud function participateIntoEvent for user XwDt4J1yXH with: It's seem like if the user is not log (still a anonymous user) and so the server can't get the session token, but I don't understand why. Any idea ? |
Can you isolate the relevant logs? Also, given the complexity/size of your function it's really tough to understand what's going on. You should probably try to reduce the size of that cloud function to isolate the failing part. |
Important logs are from my previous post: [31merror [39m: Error Generating response. ParseError {code: 208 Message: 'this auth is already used'} = 208 code, message = this auth is already used This appears each time a user. And each call of function cloudcode using 'getSessionToken ()' I have this error: 31merror [39m: Error Generating response. [TypeError: Can not read property 'getSessionToken offi undefined] I think the connection goes wrong (to view the error 'auth already used') but I do not know why. |
This error occurs when you're trying to save a user with auth data that doesn't belongs to him. I don't see any logs referring to that. Also, the session token seems properly passed to the request to your cloud code function, therefore the user should be properly set in req.user. If req.user is set, you should not have the crash you're describing. Also, because your function is so big, I can't possible write a test to make sure this can't reproduce in the future. So please, try to isolate the error and the relevant logs, and when I say relevant it's the full trace that leads to the issue. If req.user is never set in your cloudCode, you should be able to write a simple cloud function that shows it. |
Also, in the first page of your logs, you can see a user getting fetched with the Facebook authData with the Facebook ID 891415857609934. Then a few pages later, another user (with a different objectId) is trying to link it's account with the same Facebook ID. That's why you see that 'auth already used' error. You should not try to link 2 accounts with the same authData. I'm not sure what you're doing in the client, probably log out, create a new anonymous user and then link to the same Facebook Account. So far it looks like a problem in the client, not the server |
Ok I'll look on my client. But I don't understand why before the update of my parse-server everything work fine and now each function of my cloud code return this error (I talk about the 'getSessionToken()' error) |
In order to debug that, can you write a simple cloud code function that returns this session token and provide the logs (and only the logs of that call) when you call it in place of this big function? |
The function which return the code: Parse.Cloud.define("testSessionToken", function(request, response) { And the log: �[36mverbose�[39m: REQUEST for [POST] /parse/functions/testSessionToken: {} method=POST, url=/parse/functions/testSessionToken, host=test.superfc.io, x-real-ip=172.31.9.99, x-forwarded-for=82.122.57.77, 172.31.9.99, content-length=0, accept=/, accept-encoding=gzip, deflate, accept-language=fr-fr, user-agent=SFC/112 CFNetwork/758.5.3 Darwin/15.6.0, x-parse-app-build-version=112, x-parse-app-display-version=1.1.12, x-parse-application-id=29Ce3p2h29Aw9mlUvO8XkMZeXCLKl0SsJbhX8fhN, x-parse-client-key=yRdKparxomNECtqsXFkdHt9U0mKD7du48r9k1Emm, x-parse-client-version=i1.12.0, x-parse-installation-id=b584de1d-b9a1-470e-9292-8ac0a56644be, x-parse-os-version=9.3.3 (13G34), x-parse-session-token=r:7af6f0610e9a50134f01af1e644c098c, x-forwarded-port=443, x-forwarded-proto=https, Here the log of my big function: [31merror�[39m: Error generating response. [TypeError: Cannot read property 'getSessionToken' of undefined] |
In your test function, there's no response, does it crash calling getSessionToken()? Is your big function called directly or part of a hook? |
Also, this seems to be a very different issue now, as completely unrelated to the original issue. We have a unit test that specifically cover that: https://github.com/ParsePlatform/parse-server/blob/master/spec/ParseUser.spec.js#L1040 I'm locking that conversation, please reopen an issue. |
I'm using parse-server on AWS Elastic beanstalk with MongoLab and I'm getting this error when I login using Facebook:
[Error]: this auth is already used (Code: 208, Version: 1.12.0)
When I create the user via Facebook, everything is fine, but when I logout and then re-login again using Facebook I get the error.
Any ideas?
EDIT: It seems the user is created twice in the DB (one has the email, the other doesn't)
EDIT2: This error was also happening on parse.com, but more as a warning: "[Error]: Another user is already linked to this facebook id. (Code: 208, Version: 1.10.0)". This happens if the user logs out - which creates a new anonymous user - and then relogs in with Facebook. But a duplicate user was never created on parse.com. It is however created here with Parse Server.
The text was updated successfully, but these errors were encountered: