@page "/callback" @using NemAnBlazor.Services.Interfaces @inject NavigationManager NavigationMgr @inject IAuthClientService AuthService @inject Blazored.SessionStorage.ISessionStorageService sessionStorage Redirecting...

Loading...

@code { protected override async Task OnInitializedAsync() { string url = NavigationMgr.Uri; //code is the only parameter in the url string code = url.Split("=")[1]; var response = await AuthService.GetAccessToken(new GrpcShared.DTO.Auth.TokenRequest { code = code}); //store access token in local storage await sessionStorage.SetItemAsync("token", response.access_token); await sessionStorage.SetItemAsync("refresh_token", response.refresh_token); //redirect to home NavigationMgr.NavigateTo("/home"); } }