Skip to content

After authentication the events are executed on another user #4119

Closed Answered by falkoschindler
Mte90 asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, but if you'd continue reducing code, you'd end up with this:

class Dashboard:
    def __init__(self):
        self.element = None

        @ui.page('/')
        async def page():
            self.element = ui.label('Hello')
            ui.button('Click me', on_click=lambda: self.element.set_text(self.element.text + '!'))

Dashboard()

As it turns out, this has nothing to do with authentication. But you're storing UI elements in a single Dashboard instance. So every page is accessing the same self.element.

Replies: 4 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
10 replies
@Mte90
Comment options

@rodja
Comment options

@Mte90
Comment options

@falkoschindler
Comment options

Answer selected by Mte90
@Mte90
Comment options

@Mte90
Comment options

@falkoschindler
Comment options

@Mte90
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants