meetfranz / plugins

Official Franz Plugin Repository
MIT License
298 stars 110 forks source link

[Deploy] Tinder #97

Open mszczepanczyk opened 6 years ago

mszczepanczyk commented 6 years ago

Service

Tinder

Link to your repository

https://github.com/mszczepanczyk/franz-recipe-tinder

Additional Information

So this one involved some nasty hacking in order to force Tinder to recognize Facebook authentication. The problem is that window.parent.postMessage with auth credentials sent from Facebook popup doesn't hit Tinder's main window.

I've seen people approaching this by implementing the auth flow themselves and setting Facebook's generic oauth callback as the redirection url but this wouldn't work here as it's not whitelisted by Tinder. Injecting javascript/setting event callbacks on auth popup wouldn't work as well as it's immediately detected and authentication stops.

In the end I resolved this by opening Facebook's auth popup in a new BrowserWindow and hijacking the authentication code from it. But this approach has a major caveat - the popup window opened by Tinder can't be closed during authentication, so there have to be two popups open: blank - original one and the "real" one.

This could be solved if Franz provided in it's API a way to control newly created windows. The new-window event doesn't help because the window creation can't be stopped by event.preventDefault() from renderer process. Sniffing HTTP traffic from main process would probably work too.

BTW GroupMe recipe suffers from the same thing and in it's current state logging from Facebook doesn't work.

Literature

kgoldmann commented 6 years ago

@mszczepanczyk I've added this plugin locally, but can't get the Facebook authorisation to work. Two popup windows spawn, and after logging into my account, the second one disappears, the first one however remains open (empty) and the main window doesn't update.

m435tr0d commented 6 years ago

Hi, just thought I would say I am testing this now using the phone number login and everything worked excellent. The only real issue I see is that upon login it doesn't really bring you to the messages page, but that may be intended. And when it attempts to load the deck it seems that it can't get the location of the computer, which is probably because the prompt to allow the browser to access that info never shows up. Don't know if there is really a solution to that, but to me it wouldn't matter as the messenger capabilities are what I am after on this.

m435tr0d commented 6 years ago

Oh and the main point is that the messenger portion works flawlessly

mszczepanczyk commented 6 years ago

Yes facebook authentication is an issue here and I think it should be solved on a lower level as there are other plugins (already existing e.g. GroupMe or potential ones) suffering from this

Wolfenk commented 5 years ago

Couldn't make it work with Facebook auth, but works like a charm with phone number.

rursache commented 5 years ago

Facebook auth is broken but login with phone nr and its all good. we need to find a way to ask for location permission to be able to swipe tho