Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication example fails in version 2.10.1 #4302

Open
kamni opened this issue Feb 3, 2025 · 0 comments
Open

Authentication example fails in version 2.10.1 #4302

kamni opened this issue Feb 3, 2025 · 0 comments

Comments

@kamni
Copy link

kamni commented Feb 3, 2025

Description

I am using nicegui==2.10.1 under Python 3.12.

I'm attempting to use the Authentication Example in the nicegui repository, but the example is failing with the following error:

Traceback (most recent call last):
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 409, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/applications.py", line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/middleware/base.py", line 177, in __call__
    with recv_stream, send_stream, collapse_excgroups():
                                   ^^^^^^^^^^^^^^^^^^^^
  File "<masked>/.pyenv/versions/3.12.8/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
    raise exc
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/middleware/base.py", line 179, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/nicegui/middlewares.py", line 10, in dispatch
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/middleware/base.py", line 154, in call_next
    raise app_exc
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/middleware/base.py", line 141, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/middleware/gzip.py", line 20, in __call__
    await responder(scope, receive, send)
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/middleware/gzip.py", line 39, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/middleware/base.py", line 177, in __call__
    with recv_stream, send_stream, collapse_excgroups():
                                   ^^^^^^^^^^^^^^^^^^^^
  File "<masked>/.pyenv/versions/3.12.8/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
    raise exc
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/starlette/middleware/base.py", line 179, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<masked>/10000-words/frontend/main.py", line 71, in dispatch
    if not app.storage.user.get('authenticated', False):
           ^^^^^^^^^^^^^^^^
  File "<masked>/.venv/10000_words/lib/python3.12/site-packages/nicegui/storage.py", line 114, in user
    raise RuntimeError('app.storage.user needs a storage_secret passed in ui.run()')
RuntimeError: app.storage.user needs a storage_secret passed in ui.run()

I see that this problem happened before earlier last year. It seems to me that the problem may have returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant