You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
discord=DiscordOAuthClient(
_WebSettings.DISCORD_CLIENT_ID,
_WebSettings.DISCORD_CLIENT_SECRET,
_WebSettings.DISCORD_REDIRECT_URI,
("identify", "guilds"),
)
# Then in my app startupawaitdiscord.init()
Error
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: Process SpawnProcess-2:
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: Traceback (most recent call last):
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/routing.py", line 734, in lifespan
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: async with self.lifespan_context(app) as maybe_state:
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/routing.py", line 610, in __aenter__
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await self._router.startup()
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/routing.py", line 711, in startup
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await handler()
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/palshome/server.py", line 40, in app_startup
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await discord.init()
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: ^^^^^^^^^^^^
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: AttributeError: 'DiscordOAuthClient' object has no attribute 'init'
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: During handling of the above exception, another exception occurred:
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: Traceback (most recent call last):
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/usr/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: self.run()
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/usr/lib/python3.12/multiprocessing/process.py", line 108, in run
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: self._target(*self._args, **self._kwargs)
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/hypercorn/asyncio/run.py", line 195, in asyncio_worker
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: _run(
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/hypercorn/asyncio/run.py", line 233, in _run
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: runner.run(main(shutdown_trigger=shutdown_trigger))
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: return self._loop.run_until_complete(task)
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/usr/lib/python3.12/asyncio/base_events.py", line 684, in run_until_complete
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: returnfuture.result()
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: ^^^^^^^^^^^^^^^
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/hypercorn/asyncio/run.py", line 87, in worker_serve
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: raise exception
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/hypercorn/asyncio/lifespan.py", line 43, in handle_lifespan
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await self.app(
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/hypercorn/app_wrappers.py", line 34, in __call__
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await self.app(scope, receive, send)
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await super().__call__(scope, receive, send)
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await self.middleware_stack(scope, receive, send)
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 151, in __call__
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await self.app(scope, receive, send)
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/middleware/sessions.py", line 38, in __call__
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await self.app(scope, receive, send)
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 48, in __call__
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await self.app(scope, receive, send)
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/routing.py", line 758, in __call__
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await self.middleware_stack(scope, receive, send)
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/routing.py", line 767, in app
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await self.lifespan(scope, receive, send)
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/routing.py", line 749, in lifespan
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await send({"type": "lifespan.startup.failed", "message": exc_text})
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/hypercorn/asyncio/lifespan.py", line 101, in asgi_send
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: raise LifespanFailureError("startup", message.get("message", ""))
Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: hypercorn.utils.LifespanFailureError: Lifespan failure in startup. 'Traceback (most recent call last):Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/routing.py", line 734, in lifespanFeb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: async with self.lifespan_context(app) as maybe_state:Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/routing.py", line 610, in __aenter__Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await self._router.startup()Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/.local/lib/python3.12/site-packages/starlette/routing.py", line 711, in startupFeb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await handler()Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: File "/home/seizou/palshome/server.py", line 40, in app_startupFeb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: await discord.init()Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: ^^^^^^^^^^^^Feb 12 02:41:59 vmi1624817.contaboserver.net hypercorn[147863]: AttributeError: 'DiscordOAuthClient' object has no attribute 'init'
EDIT
I got able to fix the issue, it was a dependecy issue from the PyPi version. Now i'm facing another issue.
I am able to login and get my access tokens, however going over to the /authenticated route always returns Not authenticated, as if my login is not saved anywhere.
The text was updated successfully, but these errors were encountered:
How do you access /authenticated (e.g. using the built-in FastAPI docs)?
Do you provide the access token as a header? (e.g. Authorization: Bearer <redacted access token>)
Do you use the sample code from the README or examples/ or do you use modified code (except the secrets)?
How do you access /authenticated (e.g. using the built-in FastAPI docs)? Do you provide the access token as a header? (e.g. Authorization: Bearer <redacted access token>) Do you use the sample code from the README or examples/ or do you use modified code (except the secrets)?
i use the example provided by this repository.
i do not provide the access token as a header, instead i pass it as a request arg, which results in a url like the following: https://mydomain.com/authenticated?token=<token>
As /authenticated depends on discord.requires_authorization, which only processes the HTTP header, you will need to provide the access token in the header.
For testing purposes, I would recommend you using the built-in docs at /docs. You can use this interface to make requests and provide credentials.
Error
EDIT
I got able to fix the issue, it was a dependecy issue from the PyPi version. Now i'm facing another issue.
I am able to login and get my access tokens, however going over to the
/authenticated
route always returnsNot authenticated
, as if my login is not saved anywhere.The text was updated successfully, but these errors were encountered: