Redirects to Tesla authorization on missing token
All checks were successful
Build, Push and Run Container / build (push) Successful in 53s
All checks were successful
Build, Push and Run Container / build (push) Successful in 53s
The application now redirects to the Tesla authorization endpoint when the access token is missing. This ensures the user is prompted to authorize the application.
This commit is contained in:
@@ -285,7 +285,7 @@ if (app.Environment.IsDevelopment())
|
|||||||
logger.LogCritical("User has access_token: {access_token} and refresh_token: {refresh_token}", access_token, refresh_token);
|
logger.LogCritical("User has access_token: {access_token} and refresh_token: {refresh_token}", access_token, refresh_token);
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(access_token))
|
if (String.IsNullOrEmpty(access_token))
|
||||||
return Results.LocalRedirect("/Authorize");
|
return Results.LocalRedirect("/Authorize?redirect=Tesla");
|
||||||
|
|
||||||
HttpClient client = httpClientFactory.CreateClient("InsecureClient");
|
HttpClient client = httpClientFactory.CreateClient("InsecureClient");
|
||||||
client.BaseAddress = new Uri("https://tesla_command_proxy");
|
client.BaseAddress = new Uri("https://tesla_command_proxy");
|
||||||
|
|||||||
Reference in New Issue
Block a user