Implementing lock while authentication.
| 36 | |
| 37 | |
| 38 | class AuthLocker: |
| 39 | """Implementing lock while authentication.""" |
| 40 | lock = Lock() |
| 41 | |
| 42 | def __enter__(self): |
| 43 | self.lock.acquire() |
| 44 | return self |
| 45 | |
| 46 | def __exit__(self, type, value, traceback): |
| 47 | if self.lock.locked(): |
| 48 | self.lock.release() |
| 49 | |
| 50 | |
| 51 | def get_logout_url() -> str: |