displaying username and username contained in the jwt now

This commit is contained in:
filipriec
2025-04-13 14:04:30 +02:00
parent e856e9d6c7
commit 5b1db01fe6
5 changed files with 8 additions and 3 deletions

View File

@@ -28,15 +28,18 @@ pub async fn save(
auth_state.auth_token = Some(response.access_token.clone());
auth_state.user_id = Some(response.user_id.clone());
auth_state.role = Some(response.role.clone());
auth_state.decoded_username = Some(response.username.clone());
auth_state.set_has_unsaved_changes(false);
let success_message = format!(
"Login Successful!\n\n\
Username: {}\n\
Access Token: {}\n\
Token Type: {}\n\
Expires In: {}\n\
User ID: {}\n\
Role: {}",
response.username,
response.access_token,
response.token_type,
response.expires_in,
@@ -44,9 +47,6 @@ pub async fn save(
response.role
);
// Use the helper method to configure and show the dialog
// TODO Implement logic for pressing menu or exit buttons, not imeplementing it now,
// need to do other more important stuff now"
app_state.show_dialog(
"Login Success",
&success_message,