@page "/callback"
@using GrpcShared.DTO
@using GrpcShared.DTO.Db
@using NemAnBlazor.Services.Interfaces
@inject NavigationManager NavigationMgr
@inject IAuthClientService AuthService
@inject Blazored.LocalStorage.ILocalStorageService localStorage
@inject IIdentityClientService identityService
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}); //if (response.access_token == null) NavigationMgr.NavigateTo("/"); //store access token in local storage //await localStorage.SetItemAsync("token", response.AccessToken); //await localStorage.SetItemAsync("refresh_token", response.RefreshToken); //UserResponse user = new(); //await identityService.SaveUserAsync(new GrpcShared.DTO.Db.UserResponse()); string userId = await localStorage.GetItemAsync