LoginFixes
This commit is contained in:
@@ -87,7 +87,7 @@ internal sealed class AuthService : IAuthService {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
if (url.EndsWith("/", StringComparison.Ordinal)) {
|
if (url.EndsWith("/", StringComparison.Ordinal)) {
|
||||||
url = url.Remove(url.Length - 1, 1);
|
url = url.TrimEnd('/');
|
||||||
}
|
}
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ public partial class LoginViewModel : ObservableObject {
|
|||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private string? server;
|
private string? server;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private string? serverLabel;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private string title = Preferences.Default.Get("name", "Nicht") + " " + Preferences.Default.Get("surname", "eingeloggt");
|
private string title = Preferences.Default.Get("name", "Nicht") + " " + Preferences.Default.Get("surname", "eingeloggt");
|
||||||
|
|
||||||
@@ -67,7 +70,8 @@ public partial class LoginViewModel : ObservableObject {
|
|||||||
// Serveranzeige vorbereiten
|
// Serveranzeige vorbereiten
|
||||||
var apiUrl = Preferences.Default.Get("apiUrl", string.Empty);
|
var apiUrl = Preferences.Default.Get("apiUrl", string.Empty);
|
||||||
if (!string.IsNullOrWhiteSpace(apiUrl)) {
|
if (!string.IsNullOrWhiteSpace(apiUrl)) {
|
||||||
Server = "Server: " + apiUrl.Replace("/appapi", "").Replace("https://", "").Replace("http://", "");
|
Server = apiUrl.Replace("/appapi", "").Replace("https://", "").Replace("http://", "");
|
||||||
|
ServerLabel = "Server: " + Server;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Command initialisieren
|
// Command initialisieren
|
||||||
@@ -95,7 +99,7 @@ public partial class LoginViewModel : ObservableObject {
|
|||||||
IsBusy = true;
|
IsBusy = true;
|
||||||
var user = await _auth.LoginWithCredentials(Username?.Trim() ?? string.Empty,
|
var user = await _auth.LoginWithCredentials(Username?.Trim() ?? string.Empty,
|
||||||
Password ?? string.Empty,
|
Password ?? string.Empty,
|
||||||
(Server ?? string.Empty).Replace("Server:", string.Empty).Trim());
|
(Server ?? string.Empty).Trim());
|
||||||
|
|
||||||
Title = $"{user.Name} {user.Surname}";
|
Title = $"{user.Name} {user.Surname}";
|
||||||
InfoEvent?.Invoke(this, "Login erfolgreich");
|
InfoEvent?.Invoke(this, "Login erfolgreich");
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Label x:Name="ServerLabel" Text="{Binding Server}"
|
<Label x:Name="ServerLabel" Text="{Binding ServerLabel}"
|
||||||
IsVisible="{Binding Server, Converter={StaticResource StringVisibilityConverter}}" />
|
IsVisible="{Binding Server, Converter={StaticResource StringVisibilityConverter}}" />
|
||||||
|
|
||||||
<VerticalStackLayout x:Name="LoginQR" Margin="0,20,0,0" IsVisible="{Binding IsManualMode, Converter={StaticResource InverseBoolConverter}}">
|
<VerticalStackLayout x:Name="LoginQR" Margin="0,20,0,0" IsVisible="{Binding IsManualMode, Converter={StaticResource InverseBoolConverter}}">
|
||||||
|
|||||||
Reference in New Issue
Block a user