Verify state on login

This fixes "already logged in errors" if you started logging in before cancelling, and then trying again.
This commit is contained in:
Henry Hiles 2026-07-22 21:53:42 -04:00
commit 51430d2830
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
3 changed files with 17 additions and 7 deletions

View file

@ -58,6 +58,9 @@ class SelectServerPage extends HookConsumerWidget {
await ref.watch(LaunchHelper.provider).launchUrl(codeResponse.url);
AppLinks().uriLinkStream.listen((encodedUri) async {
final state = encodedUri.queryParameters["state"];
if (state != codeResponse.state) return;
final code = encodedUri.queryParameters["code"];
if (code != null) {