This is an old revision of the document!


03. [30p] Mock Authentication

Now it's the time to add authentication to our website.

  • You can use a simple server-side global variable (e.g., session) to store the user's state (e.g., an authenticated boolean + username).
  • Write the Flask functions for login.html and logout.html with the appropriate checks / actions.
  • Hint: also set the authenticated variable inside the Jinja template to conditionally display the user's status.

This is not really how it's done in practice, since the global variable will have the same value for all of the website's users (i.e., if one user authenticates, all other visitors will see the website in this state).

ii/labs/s2/02/tasks/03.1710683159.txt.gz ยท Last modified: 2024/03/17 15:45 by florin.stancu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0