Habitica: Google and Facebook registration buttons in the Settings screen don’t work

Created on 11 Nov 2017  Â·  12Comments  Â·  Source: HabitRPG/habitica

The Google and Facebook registration buttons within the User Icon > Settings screen don’t work correctly - they do not add those authentication methods to the user's account.

Console log:
site.vue?2834:514 Uncaught TypeError: e.socialLogin is not a function at click (site.vue?2834:514) at HTMLButtonElement.e (vendor.1fa51d06df40d59327b2.js:6)

help wanted medium Settings

All 12 comments

Actually the behaviour has changed since this was reported in our internal bug list. Now when you try to attach Google authentication to an existing account, you see this in a popup window:

401. That’s an error.
Error: invalid_client
The OAuth client was not found.
Request Details
That’s all we know.

and this in the console;

Uncaught (in promise) Object {error: Object, network: "google"}error: Objectcode: "cancelled"message: "Login has been cancelled"__proto__: Objectnetwork: "google"__proto__: Object__defineGetter__: __defineGetter__()__defineSetter__: __defineSetter__()__lookupGetter__: __lookupGetter__()__lookupSetter__: __lookupSetter__()constructor: Object()hasOwnProperty: hasOwnProperty()isPrototypeOf: isPrototypeOf()propertyIsEnumerable: propertyIsEnumerable()toLocaleString: toLocaleString()toString: toString()valueOf: valueOf()get __proto__: __proto__()set __proto__: __proto__()

For Facebook you see this in a popup:

Sorry, something went wrong.
We're working on getting this fixed as soon as we can.
Go Back

and much the same console message.

It's also not possible to de-register Facebook. Console log:

GET https://habitica.com/api/v3/user/auth/social/facebook 404 (Not Found)(anonymous function) @ xhr.js:178t.exports @ xhr.js:12t.exports @ dispatchRequest.js:50

Uncaught (in promise) Error: Request failed with status code 404(…)t.exports @ createError.js:16t.exports @ settle.js:18p.(anonymous function) @ xhr.js:77

I seem to have a slightly different behavior for the Facebook button pop-up.
It says:

Invalid App ID
The provided app ID does not look like a valid app ID.

Registering a new account works with both Facebook and Google, but that new account cannot be connected to the respective other social media in the settiings dialouge resulting in the same errors.

image

I believe it's because client_id is undefined? These are the request params:

client_id:undefined
response_type:token
redirect_uri:https://habitica.com/user/settings/site
state:{"network":"google","display":"popup","callback":"_hellojs_66iylvpy","state":"","redirect_uri":"https://habitica.com/user/settings/site","scope":"basic,email"}
scope:https://www.googleapis.com/auth/plus.me profile email

Why was this closed? It's still an issue.

I excitedly clicked on Register with Google in my Settings page, and got this error:

  1. That’s an error.

Error: redirect_uri_mismatch

The redirect URI in the request, https://habitica.com/, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/1035232791481-32vtplgnjnd1aufv3mcu1lthf31795fq.apps.googleusercontent.com?project=1035232791481

Learn more

Request Details
That’s all we know.

We have this fixed on our Staging site and will be pushing it live soon.

My bad! I didn't notice that the "SabreCat closed this in" status was linked to a commit. I just saw it was closed without further comment and started to panic. Carry on then, and thanks muchly for the fix I'm anxiously awaiting. :)

No problem!

@mattman71 This one, an error 401, is fixed in production. You're seeing a similar but different issue, which is an error 400 -- #8127. You should be able to work around that issue by reloading the Settings page before attempting to register, though!

@SabreCat thanks. I think I've painted myself into a corner here and don't know how to get out. My previous failed attempts at this seem to have created another beginner account with my google email, so that now when I use the register button on the settings page (of my "real" account), it just takes me to the new/bogus account using my same email. I'm not sure how to get myself out of this corner.

The good news is that I no longer get an error when clicking the register button on the settings page. lol

@mattman71 you can delete the new account from the Settings page. I
recommend logging out, then logging in using the Google sign-in button,
then deleting it to be sure its really that account you are deleting.

>

Thanks @Alys . I was able to delete the account and make a few rounds of very careful refreshes and such, and got my real account registered successfully with google.

Thanks to all who helped. Hope my validation helps for at least validating the fix with a real user (as opposed to a dev or tester, haha).

Was this page helpful?
0 / 5 - 0 ratings