This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Optional | |
| import base64 | |
| from passlib.context import CryptContext | |
| from datetime import datetime, timedelta | |
| import jwt | |
| from jwt import PyJWTError | |
| from pydantic import BaseModel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| htmx.defineExtension('bs-validation', { | |
| onEvent: function (name, evt, data) { | |
| let form = evt.detail.elt; | |
| // check if trigger attribute and submit event exists | |
| // for the form | |
| if(!form.hasAttribute('hx-trigger')){ | |
| // set trigger for custom event bs-send | |
| form.setAttribute('hx-trigger','bs-send'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script> | |
| <link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet"> | |
| </head> | |
| <body> |