From 5300aacfbd1459c054a0a48386893b500f21e1a7 Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Sat, 3 Feb 2024 21:42:18 +0800 Subject: [PATCH] refactor: polish code --- samples/sample-blazor/Components/Pages/Home.razor | 4 ++-- samples/sample-blazor/Program.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/sample-blazor/Components/Pages/Home.razor b/samples/sample-blazor/Components/Pages/Home.razor index 6a18195..d0f3be4 100644 --- a/samples/sample-blazor/Components/Pages/Home.razor +++ b/samples/sample-blazor/Components/Pages/Home.razor @@ -70,7 +70,7 @@ if (User?.Identity?.IsAuthenticated ?? false) { - await LoadTokens(); + await FetchTokenAsync(); } } @@ -84,7 +84,7 @@ NavigationManager.NavigateTo("/SignOut", forceLoad: true); } - private async Task LoadTokens() + private async Task FetchTokenAsync() { var httpContext = HttpContextAccessor.HttpContext; if (httpContext == null) diff --git a/samples/sample-blazor/Program.cs b/samples/sample-blazor/Program.cs index 7e67792..014eb11 100644 --- a/samples/sample-blazor/Program.cs +++ b/samples/sample-blazor/Program.cs @@ -14,12 +14,12 @@ options.Endpoint = builder.Configuration["Logto:Endpoint"]!; options.AppId = builder.Configuration["Logto:AppId"]!; options.AppSecret = builder.Configuration["Logto:AppSecret"]; - options.Scopes = new string[] { + options.Scopes = [ LogtoParameters.Scopes.Email, LogtoParameters.Scopes.Phone, LogtoParameters.Scopes.CustomData, LogtoParameters.Scopes.Identities - }; + ]; options.Resource = builder.Configuration["Logto:Resource"]; options.GetClaimsFromUserInfoEndpoint = true; });