Skip to content

Protected Files ( .x.py )

Sarthak Ghoshal edited this page Jul 21, 2025 · 3 revisions

Protected Files (+<...>.x.py)

Use these to keep URLs protected without proper cookie authentication

Syntax:

# +<vip>.x.py

from reactpy import component, html


@component
def vip(checker, goto):
  if checker.get("vip") == 'yes':
    return html.h1("vip")
  else:
    return goto("/")
  • checker is flask's request.cookies
  • goto is a script that send the user back to the parameter given

Clone this wiki locally