(admin: Admin)
| 5 | |
| 6 | |
| 7 | async def logout_admin(admin: Admin): |
| 8 | # 1. remove token |
| 9 | async with postgres_pool.get_db_connection() as conn: |
| 10 | await conn.execute( |
| 11 | """ |
| 12 | UPDATE app_admin SET token = NULL, updated_timestamp = $1 |
| 13 | WHERE admin_id = $2 |
| 14 | """, |
| 15 | current_timestamp_int_milliseconds(), |
| 16 | admin.admin_id, |
| 17 | ) |
| 18 | admin.token = None |
| 19 | |
| 20 | # 2. remove from redis |
| 21 | await admin_ops.redis.pop(admin) |
| 22 | |
| 23 | return admin |
nothing calls this directly
no test coverage detected