cross-solution / cross-solution.de

Homepage of CROSS Solution uses Strapi Backend cross-solution/cms
https://cross-solution.de
MIT License
2 stars 11 forks source link

How do we store local Settings #54

Closed cbleek closed 4 years ago

cbleek commented 4 years ago

When running the app in electron, and clicking on the facebook button, the authentification does not work.

Bildschirmfoto 2020-02-24 um 21 13 20

This is probably because we set the app id only in https://github.com/cross-solution/cross-solution.de/blob/master/src/boot/hello.js. An app secret is set nowhere. Maybe the auth is working in the web app (ssr:pwa mode) because facebook can determine a Hostname, which is sending requests.

Bildschirmfoto 2020-02-24 um 21 21 08

However. We have to answer the question, how to store user settings in an electron app.

@calmcalmdown do you have an idea?

sr7dev commented 4 years ago

@cbleek let me check first asap

sr7dev commented 4 years ago

Hi @cbleek I have logged in successfully. Please check the following screenshots

sr7dev commented 4 years ago

first, setting with facebook developer account http://prntscr.com/r76vc0

sr7dev commented 4 years ago

next, add APP_ID_FACEBOOK http://prntscr.com/r76vtb

sr7dev commented 4 years ago

tested on my local, and worked for me. http://prntscr.com/r76xiw

cbleek commented 4 years ago

But does it runs as an electron app?

sr7dev commented 4 years ago

@cbleek i found why it is not working. maybe we don't need the app secret. image As you can see the client id(app id) is undefined

cbleek commented 4 years ago

But the headline of your screen shows "Google Chrome". Is the app running as an electron as described in:

https://cross-solution.de/download

cbleek commented 4 years ago

but you're right. The client_id seem's to be missing. I'f I clich on LinkedIn button running in electron mode I get the LinkedIn Response

The passed in client_id is invalid "undefined"

So the values defined in .env might be not inserted, when building the electron app.

sr7dev commented 4 years ago

@cbleek yeah, I think so

cbleek commented 4 years ago

However. The focus of this issue should be to think about how to store user settings. These .env values are some kind of user settings, I guess.

sr7dev commented 4 years ago

@cbleek i have made .env.production file and tested app. there is another error, maybe it is from facebook app settings. image

sr7dev commented 4 years ago

could you give me facebook app settings?

sr7dev commented 4 years ago

@cbleek please take a look at process.env.APP_URL in electron-main.js image I have tested on my local like the following steps.

sr7dev commented 4 years ago

@cbleek any update?

cbleek commented 4 years ago

I've added the the env in a page and it shows the localhost:8080 is used by default. If the Port is already in use, quasar seems to search the next available port. If you start the app twice, the second one uses 8081.

I'm willing to bet that OAuth will work if that secret is sent along.

Whatever. Let's close this issue and open a new one for the OAuth problem.

Bildschirmfoto 2020-02-26 um 11 03 20