mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 23:01:52 +01:00
Fixed: InvalidCredentials Alert
This commit is contained in:
parent
fbf249c54e
commit
85ae6767ae
@ -79,6 +79,12 @@ namespace Borepin.PageModel.AddServerProcess
|
||||
public async Task AuthenticateCommandExecute()
|
||||
{
|
||||
IsBusy = true;
|
||||
if(Username == null || Username == String.Empty || Password == null || Password == String.Empty)
|
||||
{
|
||||
IsBusy = false;
|
||||
return;
|
||||
}
|
||||
|
||||
Username = Username.Trim();
|
||||
|
||||
_ConnectionData = new ConnectionData()
|
||||
@ -116,6 +122,16 @@ namespace Borepin.PageModel.AddServerProcess
|
||||
});
|
||||
return;
|
||||
}
|
||||
catch (InvalidCredentialsException)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
await _PageDialogService.DisplayAlertAsync(Resources.Text.TextResource.ALERT_ConnectionFailed, Resources.Text.TextResource.ALERT_CredentialsInvalid, Resources.Text.TextResource.OK).ConfigureAwait(false);
|
||||
|
||||
IsBusy = false;
|
||||
});
|
||||
return;
|
||||
}
|
||||
catch (AuthenticationFailedException)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
@ -126,7 +142,7 @@ namespace Borepin.PageModel.AddServerProcess
|
||||
});
|
||||
return;
|
||||
}
|
||||
catch(Exception)
|
||||
catch(Exception ex)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
|
@ -109,7 +109,7 @@ namespace Borepin.PageModel
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
await _PageDialogService.DisplayAlertAsync(Resources.Text.TextResource.ALERT, Resources.Text.TextResource.Alert_QRInvalid, Resources.Text.TextResource.OK).ConfigureAwait(false);
|
||||
await _PageDialogService.DisplayAlertAsync(Resources.Text.TextResource.ALERT, Resources.Text.TextResource.ALERT_QRInvalid, Resources.Text.TextResource.OK).ConfigureAwait(false);
|
||||
IsScanning = true;
|
||||
});
|
||||
return;
|
||||
|
@ -69,23 +69,37 @@ namespace Borepin.PageModel
|
||||
}
|
||||
});
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (ConnectingFailedException)
|
||||
{
|
||||
if (ex is AuthenticationFailedException)
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
await _PageDialogService.DisplayAlertAsync(Resources.Text.TextResource.ALERT_ConnectionFailed, Resources.Text.TextResource.ALERT_AuthServer, Resources.Text.TextResource.OK).ConfigureAwait(false);
|
||||
});
|
||||
}
|
||||
else if (ex is ConnectingFailedException)
|
||||
await _PageDialogService.DisplayAlertAsync(Resources.Text.TextResource.ALERT_ConnectionFailed, Resources.Text.TextResource.ALERT_UnableServer, Resources.Text.TextResource.OK).ConfigureAwait(false);
|
||||
});
|
||||
}
|
||||
catch (AuthenticationFailedException)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
await _PageDialogService.DisplayAlertAsync(Resources.Text.TextResource.ALERT_ConnectionFailed, Resources.Text.TextResource.ALERT_UnableServer, Resources.Text.TextResource.OK).ConfigureAwait(false);
|
||||
});
|
||||
}
|
||||
await _PageDialogService.DisplayAlertAsync(Resources.Text.TextResource.ALERT_ConnectionFailed, Resources.Text.TextResource.ALERT_AuthServer, Resources.Text.TextResource.OK).ConfigureAwait(false);
|
||||
});
|
||||
}
|
||||
catch (InvalidCredentialsException)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
await _PageDialogService.DisplayAlertAsync(Resources.Text.TextResource.ALERT_ConnectionFailed, Resources.Text.TextResource.ALERT_CredentialsInvalid, Resources.Text.TextResource.OK).ConfigureAwait(false);
|
||||
});
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
await _PageDialogService.DisplayAlertAsync(Resources.Text.TextResource.ALERT_UnexpectedError, Resources.Text.TextResource.ALERT_UnableServer, Resources.Text.TextResource.OK).ConfigureAwait(false);
|
||||
});
|
||||
}
|
||||
|
||||
if (_API.IsConnected == false)
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/ServerListPage").ConfigureAwait(false);
|
||||
|
@ -188,6 +188,15 @@ namespace Borepin.Resources.Text {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Credentials are invalid. ähnelt.
|
||||
/// </summary>
|
||||
internal static string ALERT_CredentialsInvalid {
|
||||
get {
|
||||
return ResourceManager.GetString("ALERT_CredentialsInvalid", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Connection already exist. Please delete old Connection before adding the new Connection. ähnelt.
|
||||
/// </summary>
|
||||
@ -209,9 +218,9 @@ namespace Borepin.Resources.Text {
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die QR Code is invalid ähnelt.
|
||||
/// </summary>
|
||||
internal static string Alert_QRInvalid {
|
||||
internal static string ALERT_QRInvalid {
|
||||
get {
|
||||
return ResourceManager.GetString("Alert_QRInvalid", resourceCulture);
|
||||
return ResourceManager.GetString("ALERT_QRInvalid", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
@ -450,6 +459,15 @@ namespace Borepin.Resources.Text {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Unlock ähnelt.
|
||||
/// </summary>
|
||||
internal static string MachinePage_Unlock {
|
||||
get {
|
||||
return ResourceManager.GetString("MachinePage_Unlock", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Use ähnelt.
|
||||
/// </summary>
|
||||
|
@ -161,13 +161,16 @@ You can also put down several servers and then connect to the desired server.</v
|
||||
<data name="ALERT_ConnectionFailed" xml:space="preserve">
|
||||
<value>Connection failed</value>
|
||||
</data>
|
||||
<data name="ALERT_CredentialsInvalid" xml:space="preserve">
|
||||
<value>Credentials are invalid.</value>
|
||||
</data>
|
||||
<data name="ALERT_DuplicateConnection" xml:space="preserve">
|
||||
<value>Connection already exist. Please delete old Connection before adding the new Connection.</value>
|
||||
</data>
|
||||
<data name="ALERT_PasswordInvalid" xml:space="preserve">
|
||||
<value>Password is invalid.</value>
|
||||
</data>
|
||||
<data name="Alert_QRInvalid" xml:space="preserve">
|
||||
<data name="ALERT_QRInvalid" xml:space="preserve">
|
||||
<value>QR Code is invalid</value>
|
||||
</data>
|
||||
<data name="ALERT_UnableServer" xml:space="preserve">
|
||||
@ -249,6 +252,9 @@ Ask in your Space if you can be trained on the machine to be unlocked for the ma
|
||||
<data name="MachinePage_OpenWiki" xml:space="preserve">
|
||||
<value>Open Wiki</value>
|
||||
</data>
|
||||
<data name="MachinePage_Unlock" xml:space="preserve">
|
||||
<value>Unlock</value>
|
||||
</data>
|
||||
<data name="MachinePage_Use" xml:space="preserve">
|
||||
<value>Use</value>
|
||||
</data>
|
||||
|
Loading…
x
Reference in New Issue
Block a user