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

Cannot redirect from mount() #648

Open
recurvelabs opened this issue Jan 27, 2024 · 0 comments
Open

Cannot redirect from mount() #648

recurvelabs opened this issue Jan 27, 2024 · 0 comments

Comments

@recurvelabs
Copy link

Often I want to apply some auth or billing style checks in the mount() but this doesn't appear to work:

class TestView(UnicornView):

    def mount(self):
        return redirect("/")

My current hacky workaround is to define a load() method that gets called by unicorn:visible - basically redirecting anytime after the page is loaded is working as expected..

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

0 participants