node-flickrapi
node-flickrapi copied to clipboard
Authorization from an Electron App
Hello, this is not a bug but more of a cry for help. The authorization options include the callback method and the "Paste the oauth_verifier" one but neither is good when having a Electron Desktop App cause there's no callback nor console to type that verifier. I'd like to have an input field where the user can type that in, but how do I give that value to the Flickr object? Thank you very much!
In case someone reads this and has the same problem. For some use cases hardcoding the access token after requiring it manually works just fine, because it does not expire unless it gets revoked at flickr.
Can electron apps not let you write an input dialog that you then tie back into the auth?
Electron does not support prompt, because it would block the main thread (https://github.com/electron/electron/issues/472). Is there a way to manually put the verification code in?
I didn't say prompt()
though. If it's effectively a webapp, can you not just use any of the million "overlay div with an input field and change handing js" dialog solutions?
I have not tried it yet, because for my use case the solution of hardcoding is fine. For most other it is not, so I will look into building a better solution some time soon. Also I am not sure if I can write a prompt replacement, so your code just works, or if I have to make changes to it. It is a limitation in electron I have come across for the first time.
Gotcha