File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1047,10 +1047,22 @@ export function newAppInstance (
10471047 * and/or a developer
10481048 */
10491049export async function getUserRoles ( ) : Promise < Array < NamedNode > > {
1050+ const sessionInfo = authSession . info
1051+ if ( ! sessionInfo ?. isLoggedIn || ! sessionInfo ?. webId ) {
1052+ return [ ]
1053+ }
1054+
1055+ const currentUser = authn . currentUser ( )
1056+ if ( ! currentUser ) {
1057+ return [ ]
1058+ }
1059+
10501060 try {
1051- const { me, preferencesFile, preferencesFileError } = await ensureLoadedPreferences ( { } )
1061+ const { me, preferencesFile, preferencesFileError } = await ensureLoadedPreferences ( {
1062+ me : currentUser
1063+ } )
10521064 if ( ! preferencesFile || preferencesFileError ) {
1053- throw new Error ( preferencesFileError )
1065+ throw new Error ( preferencesFileError || 'Unable to load user preferences file.' )
10541066 }
10551067 return solidLogicSingleton . store . each (
10561068 me ,
You can’t perform that action at this time.
0 commit comments