mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 22:07:28 +02:00
Initial version.
This commit is contained in:
parent
193aaa1a56
commit
b72c67a53e
228 changed files with 25924 additions and 0 deletions
|
@ -0,0 +1,48 @@
|
|||
namespace TINK.Model.Repository.Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Is fired with reqest used a cookie which is not defined.
|
||||
/// Reasons for cookie to be not defined might be
|
||||
/// - user used more thant 8 different devices (copri invalidates cookies in this case)
|
||||
/// - user account has been deleted?
|
||||
/// </summary>
|
||||
public class AuthcookieNotDefinedException : InvalidResponseException<Response.ResponseBase>
|
||||
{
|
||||
/// <summary>Constructs a authorization exceptions. </summary>
|
||||
/// <param name="p_strTextOfAction">Text describing request which is shown if validation fails.</param>
|
||||
public AuthcookieNotDefinedException(string p_strTextOfAction, Response.ResponseBase response) :
|
||||
base($"{p_strTextOfAction}\r\nDie Sitzung ist abgelaufen. Bitte neu anmelden.", response)
|
||||
{
|
||||
}
|
||||
|
||||
public static bool IsAuthcookieNotDefined(
|
||||
Response.ResponseBase reponse,
|
||||
string actionText,
|
||||
out AuthcookieNotDefinedException exception)
|
||||
{
|
||||
if (!reponse.response_state.ToUpper().Contains(AUTH_FAILURE_QUERY_AUTHCOOKIENOTDEFIED.ToUpper())
|
||||
&& !reponse.response_state.ToUpper().Contains(AUTH_FAILURE_BOOK_AUTICOOKIENOTDEFIED.ToUpper())
|
||||
&& !reponse.response_state.ToUpper().Contains(AUTH_FAILURE_BIKESOCCUPIED_AUTICOOKIENOTDEFIED.ToUpper())
|
||||
&& !reponse.response_state.ToUpper().Contains(AUTH_FAILURE_LOGOUT_AUTHCOOKIENOTDEFIED.ToUpper()))
|
||||
{
|
||||
exception = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
exception = new AuthcookieNotDefinedException(actionText, reponse);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary> Holds error description if session expired. From COPRI 4.0.0.0 1001 is the only authcookie not defined error. </summary>
|
||||
private const string AUTH_FAILURE_QUERY_AUTHCOOKIENOTDEFIED = "Failure 1001: authcookie not defined";
|
||||
|
||||
/// <summary> Holds error description if session expired (Applies to COPRI < 4.0.0.0) </summary>
|
||||
private const string AUTH_FAILURE_BOOK_AUTICOOKIENOTDEFIED = "Failure 1002: authcookie not defined";
|
||||
|
||||
/// <summary> Holds error description if session expired (Applies to COPRI < 4.0.0.0) </summary>
|
||||
private const string AUTH_FAILURE_BIKESOCCUPIED_AUTICOOKIENOTDEFIED = "Failure 1003: authcookie not defined";
|
||||
|
||||
/// <summary> Holds error description if session expired. (Applies to COPRI < 4.0.0.0)</summary>
|
||||
private const string AUTH_FAILURE_LOGOUT_AUTHCOOKIENOTDEFIED = "Failure 1004: authcookie not defined";
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue