Snippet library

Copy-ready, tested snippets for Python, Flask, JavaScript, SQL, HTML, CSS and Bash. Open any of them in the playground.

2 snippets

flask

Login-required decorator for JSON routes

Answer 401 JSON instead of redirecting to the login page.

intermediate #auth#decorators#api
flask

Signed, expiring links

Make email-verification or reset links that expire, without a database table.

intermediate #auth#email#tokens