(username, password, context: SqlalchemyContext)
| 6 | |
| 7 | @hug.authentication.basic |
| 8 | def basic_authentication(username, password, context: SqlalchemyContext): |
| 9 | return context.db.query( |
| 10 | context.db.query(TestUser) |
| 11 | .filter(TestUser.username == username, TestUser.password == password) |
| 12 | .exists() |
| 13 | ).scalar() |