fix: clear old auth record before device code flow to force fresh login

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-23 21:22:03 +02:00
co-authored by Claude Opus 4.6
parent dd9e2f4acd
commit 40c9607598
+5 -6
View File
@@ -436,14 +436,13 @@ async def trigger_poll():
def cli_auth():
"""Run Azure device code authentication from terminal."""
database.init_db()
graph = GraphAPI()
if graph.is_authenticated():
print("Bereits authentifiziert.")
return
# Clear old auth record to force fresh device code flow
database.set_setting("azure_auth_record", "")
print("Starte Azure Device Code Authentifizierung...")
print("Bitte den angezeigten Code im Browser eingeben.")
print("Bitte den angezeigten Code im Browser eingeben.\n")
graph = GraphAPI()
graph.authenticate()
print("Authentifizierung erfolgreich!")
print("\nAuthentifizierung erfolgreich!")
if __name__ == "__main__":