I have a situation where I have a razor page -sign.cshtml that handles OAuth by using PageModel's OnGetAsync and OnGetCallbackAsync
Question #1 How can I do this alternatively just using Razor component (*.razor) instead of ".cshtml"?
I also inject a viewmodel and a shared service ("sharedservice") that holds user data.
In OnCallBackAsync, upon successful Oauth authetication I save user data in an object "OAuthUser" object via shared service that I injected.
in the same call back method I use LocalRedirect to a razor component (signup.razor)
In the singup.razor I inject the shared service ("sharedservice") but instance I get is new instance instead of the one used by sign.cshtml, so I lost the user's data saved upon authentication.
I came to know that using LocalRedirect causes a new request and hence it creates a new instance, is this correct?
QUestion #3
How can I sustain the user data when I navigate from *.cshtml razor page to a razor component *razor using LOcalDirect. I have to use LOcalDirect because NavigateTo does not work and so doesn't the RedirectToPage or Redirect.
I thought I would use TempData but does not work in Razor Component (*.razor)
ANy help would be appreciated.