Skip to content
Discussion options

You must be logged in to vote

Thanks for reaching out, @espeoceka!

I was confused at first, since it is working without async. But now I'm actually not sure, why it is working at all...
As the type annotation says, logout is supposed to build a UI and return nothing. But instead it returns a FastAPI response. So logout isn't a NiceGUI page function, but a regular FastAPI endpoint. Therefore it should be decorated with app.get instead of ui.page.

For example, the following code is working with and without async:

@app.get('/redirect')
async def redirect() -> None:
    return RedirectResponse('/')

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
1 reply
@ed2050
Comment options

Answer selected by falkoschindler
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
9 replies
@rodja
Comment options

@falkoschindler
Comment options

@falkoschindler
Comment options

@espeoceka
Comment options

@ysharoiko
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #547 on March 18, 2023 14:51.