Crdl
Crdl
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
If you manually call JSRuntime.InvokeAsync(authentication service.getUser) or whatever at that point in the code, what do you get back?
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
Worth trying to turn this caching off at any rate
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
I was thinking that GetAuthenticationStateAsync could be being called before everything is set up.. but actually if it's just fetching from JS then I have no idea
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
Hmm, not sure if necessarily a bug. We've not used RemoteAuthenticationService internally we've just inherited from AuthenticationStateProvider directly
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
You're fetching the base one on line 27 of what you sent me
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
Am currently at work unfortunately 😂
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
What's in the base class?
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
@Kyr can I see the rest of your AuthenticationStateProvider?
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
Just a hunch, maybe just double check your middleware is in the right order on the server?
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
And see how that differs after you refresh
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
Can you log in there basically everything you should have?
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
Is the first GetAuthenticationState call actually getting what you expect?
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
I'd log just to make sure there's no weird order of operations bug
49 replies
CC#
Created by Kyr on 8/12/2024 in #help
Blazor Web Assembly (stand alone) - [Authorize] Attribute not recognising roles straight after login
Is GetAuthenticationState being called again once you land back on the protected route?
49 replies