From b1a3bcd8c434e7b4a270dd9a6e292a0a320097c7 Mon Sep 17 00:00:00 2001 From: Dillon Nys Date: Fri, 8 Mar 2024 18:06:29 -0800 Subject: [PATCH] Fix init --- packages/celest_auth/lib/src/auth_impl.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/celest_auth/lib/src/auth_impl.dart b/packages/celest_auth/lib/src/auth_impl.dart index f0216501..690a8792 100644 --- a/packages/celest_auth/lib/src/auth_impl.dart +++ b/packages/celest_auth/lib/src/auth_impl.dart @@ -43,10 +43,11 @@ final class AuthImpl implements Auth { try { final user = await protocol.userInfo(); initialState = Authenticated(user); + _authStateController.add(initialState); } on UnauthorizedException { initialState = const Unauthenticated(); + signOut(); } - _authStateController.add(initialState); return initialState; }); }