Skip to content

Commit eb8bd6f

Browse files
committed
Fix the issue that in some scenarios, the username cannot be parsed from web ID
1 parent 8fe7d5f commit eb8bd6f

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ au](https://solidcommunity.au/docs/solidui)
1717

1818
+ Remove solidui/solidpod circular dependency [0.0.7 20251029 gjw]
1919
+ Refactor SOlidLogin for max 300 loc lint [0.0.6 20251017 cdawei]
20-
+ Fix security key handling [0.0.5 20251027 tchecn]
20+
+ Fix security key handling [0.0.5 20251027 tchen]
2121
+ Add webid to an info header in navdrawer [0.0.4 20251017 tchen]
2222
+ Update version widget dependency [0.0.3 20251008 gjw]
2323
+ EXAMPLE: Add demo of getting version [0.0.2 20250820 gjw]

lib/src/screens/initial_setup_widgets/res_create_form_submission.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ library;
3333
import 'package:flutter/material.dart';
3434

3535
import 'package:flutter_form_builder/flutter_form_builder.dart';
36-
import 'package:solidpod/solidpod.dart' show initPod;
36+
import 'package:solidpod/solidpod.dart' show KeyManager;
3737

3838
import 'package:solidui/src/constants/initial_setup.dart';
3939
import 'package:solidui/src/widgets/solid_animation_dialog.dart';
@@ -167,14 +167,13 @@ ElevatedButton resCreateFormSubmission(
167167
final securityKey = formData[securityKeyStr].toString();
168168

169169
try {
170-
// await _initPodOriginalFunc(securityKey);
171-
await initPod(
172-
securityKey,
173-
dirUrls: resFoldersLink,
174-
fileUrls: resFilesLink,
175-
);
170+
// Initialise the POD with the security key.
171+
// Set up the KeyManager and create verification keys.
172+
173+
await KeyManager.initPodKeys(securityKey);
174+
debugPrint('POD initialised with security key');
176175
} on Exception catch (e) {
177-
debugPrint(e.toString());
176+
debugPrint('Error initialising POD: $e');
178177
}
179178

180179
await Navigator.pushReplacement(

lib/src/widgets/solid_dynamic_login_status.dart

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,22 @@ class _SolidDynamicLoginStatusState extends State<SolidDynamicLoginStatus> {
178178
loggedOutTooltip: widget.loggedOutTooltip,
179179
);
180180

181-
// Create the updated status bar configuration with dynamic login status.
181+
// Create dynamic server info from webId if available, otherwise use base
182+
// config.
183+
184+
final dynamicServerInfo = _currentWebId != null && _currentWebId!.isNotEmpty
185+
? SolidServerInfo.fromWebId(
186+
_currentWebId!,
187+
tooltip: widget.baseConfig.serverInfo?.tooltip,
188+
isClickable: widget.baseConfig.serverInfo?.isClickable ?? true,
189+
)
190+
: widget.baseConfig.serverInfo;
191+
192+
// Create the updated status bar configuration with dynamic login status
193+
// and server info.
182194

183195
final updatedConfig = SolidStatusBarConfig(
184-
serverInfo: widget.baseConfig.serverInfo,
196+
serverInfo: dynamicServerInfo,
185197
loginStatus: dynamicLoginStatus,
186198
onLogin: widget.baseConfig.onLogin,
187199
securityKeyStatus: widget.baseConfig.securityKeyStatus,

0 commit comments

Comments
 (0)