dnplus / streamlit-oauth

Simple OAuth Component for Streamlit App
MIT License
150 stars 23 forks source link

AttributeError: 'NoneType' object has no attribute 'split' #50

Closed lilyx998 closed 3 months ago

lilyx998 commented 3 months ago

Full error output:

File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 589, in _run_script
    exec(code, module.__dict__)
File "/app/main.py", line 16, in <module>
    from auth import get_userid, show_auth
File "/app/auth.py", line 7, in <module>
    from streamlit_oauth import OAuth2Component
File "/usr/local/lib/python3.9/site-packages/streamlit_oauth/__init__.py", line 167, in <module>
    result = oauth2.authorize_button("Continue with Google", REDIRECT_URI, SCOPE, icon="data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 48 48'%3E%3Cdefs%3E%3Cpath id='a' d='M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z'/%3E%3C/defs%3E%3CclipPath id='b'%3E%3Cuse xlink:href='%23a' overflow='visible'/%3E%3C/clipPath%3E%3Cpath clip-path='url(%23b)' fill='%23FBBC05' d='M0 37V11l17 13z'/%3E%3Cpath clip-path='url(%23b)' fill='%23EA4335' d='M0 11l17 13 7-6.1L48 14V0H0z'/%3E%3Cpath clip-path='url(%23b)' fill='%2334A853' d='M0 37l30-23 7.9 1L48 0v48H0z'/%3E%3Cpath clip-path='url(%23b)' fill='%234285F4' d='M48 48L17 24l-4-3 35-10z'/%3E%3C/svg%3E", use_container_width=True, pkce="S256", extras_params={"prompt": "consent", "access_type": "offline"})
File "/usr/local/lib/python3.9/site-packages/streamlit_oauth/__init__.py", line 83, in authorize_button
    scope=scope.split(" "),

Not sure why this Google authorize button is being created, because I'm connecting to a different service. Maybe related to this? https://github.com/dnplus/streamlit-oauth/blob/55baab68c21e8d02d28846eddf6798568aab4e11/streamlit_oauth/__init__.py#L153 I don't believe I've personally set _RELEASE anywhere.

Thanks for the library!

dnplus commented 3 months ago

wrong file was publish to pypi

fix in 0.1.13