Bladesfist
Bladesfist
CC#
Created by Jelles on 8/8/2024 in #help
Google Auth invalid OAuth state
This problem looks similar, not sure if it helps you? https://github.com/dotnet/aspnetcore/issues/22125
16 replies
CC#
Created by Jelles on 8/8/2024 in #help
Google Auth invalid OAuth state
Ah, in that case I'll back out as I don't have much experience with the built in bits
16 replies
CC#
Created by Jelles on 8/8/2024 in #help
Google Auth invalid OAuth state
Asp.NetCore.Identity or IdentityServer?
16 replies
CC#
Created by Jelles on 8/8/2024 in #help
Google Auth invalid OAuth state
What do you mean by identity?
16 replies
CC#
Created by Jelles on 8/8/2024 in #help
Google Auth invalid OAuth state
The code you've posted doesn't really show the login process at all afaict so it's hard to provide anything more than generic OAuth advice
16 replies
CC#
Created by Jelles on 8/8/2024 in #help
Google Auth invalid OAuth state
16 replies
CC#
Created by Jelles on 8/8/2024 in #help
Google Auth invalid OAuth state
Do you have a query parameter called state when you hit the Authorize endpoint?
16 replies
CC#
Created by SparkyCracked on 3/18/2024 in #help
✅ System threading tasks
Don't share mutatable state and you're golden
20 replies
CC#
Created by SparkyCracked on 3/18/2024 in #help
✅ System threading tasks
Sounds reasonable
20 replies
CC#
Created by SparkyCracked on 3/18/2024 in #help
✅ System threading tasks
Oh so you'll have an Item[] response?
20 replies
CC#
Created by SparkyCracked on 3/18/2024 in #help
✅ System threading tasks
Not sure I know what you mean, to wrap the array response from the task? Probably not
20 replies
CC#
Created by SparkyCracked on 3/18/2024 in #help
✅ System threading tasks
Shouldn't be an issue, technically it's returning a reference to the array anyway so it's just the size of a ref, not a copy of the full array
20 replies
CC#
Created by SparkyCracked on 3/18/2024 in #help
✅ System threading tasks
Also if you want, you can install Polly (https://www.nuget.org/packages/polly/) which has timeout as well as a bunch of other resilience strategies built in
20 replies
CC#
Created by SparkyCracked on 3/18/2024 in #help
✅ System threading tasks
Task.Run is most likely the culprit here for moving the task to the other thread, can you make that task return data that the main thread awaits and then uses to update the UI?
20 replies
CC#
Created by Savage on 9/13/2023 in #help
✅ Problems with mocking a ServiceProvider
So you can pass your own ServiceProvider in to it
70 replies
CC#
Created by Savage on 9/13/2023 in #help
✅ Problems with mocking a ServiceProvider
If you're unit testing I assume you are not building the WebApplication, just creating the system under test directly?
70 replies
CC#
Created by Savage on 9/13/2023 in #help
✅ Problems with mocking a ServiceProvider
ServiceProvider = sc.BuildServiceProvider();
70 replies
CC#
Created by Savage on 9/13/2023 in #help
✅ Problems with mocking a ServiceProvider
ServiceCollection sc = new ServiceCollection();
70 replies
CC#
Created by Savage on 9/13/2023 in #help
✅ Problems with mocking a ServiceProvider
Nah you can forget all of that if this is a unit test
70 replies
CC#
Created by Savage on 9/13/2023 in #help
✅ Problems with mocking a ServiceProvider
In that case I'd do what @Patrick mentioned and just create a real service provider with your mock services registered into it and pass that to the sut that requires IServiceProvider
70 replies