tylerjrichards / st-paywall

A python package for creating subscription Streamlit apps
MIT License
266 stars 52 forks source link

Logout Problem if you login salesforce #58

Open selcukgoktas opened 7 months ago

selcukgoktas commented 7 months ago

When I login + subscribe = > logout button working fine.

after login + subscribe if I login to Salesforce, this will redirect url and ?code=aPrxE1W6m&state=sandbox add salesforce authentication code to the url.

if url is something like that logout button is not working.

http://localhost:8501/ ?code=aPrxE1W6m&state=sandbox

tylerjrichards commented 7 months ago

hey @selcukgoktas, what do you mean log in to salesforce? can you give me some more details on this? Like, you're logging in to google and salesforce?

selcukgoktas commented 7 months ago

2024-02-23_02h01_02

1- I'll login with google

http://localhost:8501/?code=4%2F0AeaYSHAc-fTr2LufPPjTUAq8apgIaRZ2fw&scope=email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+openid&authuser=1&prompt=consent

google return url something like that.

2 - I login with salesforce

2024-02-23_02h04_03

and after login url redirect http://localhost:8501/?code=aPrxVFXz_swY7sg%3D%3D&state=production

something like that.

Because st-paywall try to read code from url it get some error like screen and logout button will disappeared.

I add a new st.button and keep google state in localstorage and after salesforce login I keep this data on session state and add localstorage google data to session state.

This way I can get both google , stripe subscription and salesforce api details and use them.

for log out st.button will handle this. currently.

selcukgoktas commented 7 months ago

2024-02-23_02h10_23

I'm using this to clear states and local storage. then It will make me log out.