in my application I'm using AzureAD coneector for authentication- OnStart property is set to -
If(
!IsEmpty(
AzureAD.CheckMemberGroupsV2(
User().Email,
["cfxxxxa0-7xx6-48x9-bxf3-xxxxxxxxxxx"]
).value
),
Set(
varAdmin,
true
),
Set(
varAdmin,
false
)
);
now what I want is - if the user does not belong to that particular Azure AD group he should be navigated to some error screen. and if he has access the home screen of the application should appear.
I tried using below code on onstart screen property. but I'm getting global variables are not allowed in start screen error
If(varAdmin = false, ErrorScreen, HomeScreen) ;
How am I suppose to redirect the user to the respective screens?