Skip to content

How do you deal with HttpContext being null? #1440

Closed Answered by TimMurphy
TimMurphy asked this question in Q&A
Discussion options

You must be logged in to vote

Here's the answer :-)

var externalLoginInfo = new ExternalLoginInfo(
   new ClaimsPrincipal(), 
   "login provider", 
   "provider key", 
   "provider display name"
);

var component = testContext.RenderComponent<ExternalLogin>(parameters => parameters
   .Add(p => p.HttpContext, new DefaultHttpContext())
   .Add(p => p.ExternalLoginInfo, externalLoginInfo)
);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@egil
Comment options

egil Apr 12, 2024
Maintainer

Answer selected by TimMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants