We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 865ad01 + 7a0ca3f commit 0e85c58Copy full SHA for 0e85c58
1 file changed
lib/services/pocketbase_service.dart
@@ -39,6 +39,20 @@ class PocketBaseService {
39
40
_client = PocketBase(savedUrl, authStore: store);
41
_isInitialized = true;
42
+
43
+ await refreshAuth();
44
+ }
45
46
+ Future<void> refreshAuth() async {
47
+ if (client.authStore.isValid) {
48
+ try {
49
+ await client.collection('users').authRefresh();
50
+ } catch (e) {
51
+ if (e is ClientException && e.statusCode != 0) {
52
+ client.authStore.clear();
53
54
55
56
}
57
58
Future<RecordAuth> register(String email, String password) async {
0 commit comments