nextcloud / windows-universal

📱 Nextcloud Windows Mobile app
https://www.microsoft.com/store/apps/9nblggh532xq
Mozilla Public License 2.0
59 stars 34 forks source link

catch server error 401 - Unauthorized #251

Open SunboX opened 6 years ago

SunboX commented 6 years ago

If the user credentials have changed, the application will throw an error because of an 401 server response.

This should be catched, the user should be notified like "Your credentials have changed, you have to login again." and he should be navigated to the login page. Also delete the current user login from the settings and prefill the server address input field of the login mask with the address from the settings.

[Type]:[System.Exception]
[ExceptionMessage]:[The remote server returned an error: (401) Unauthorized.]
[StackTrace]:[
   at NextcloudApp!<BaseAddress>+0x5d2ab1
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at SharedLibrary!<BaseAddress>+0x368a33
   at SharedLibrary!<BaseAddress>+0x369031
   at SharedLibrary!<BaseAddress>+0x369b49
   at NextcloudApp!<BaseAddress>+0x6ed7dd
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at SharedLibrary!<BaseAddress>+0x368a33
   at SharedLibrary!<BaseAddress>+0x369031
   at SharedLibrary!<BaseAddress>+0x369b49
   at NextcloudApp!<BaseAddress>+0x6ed059
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at NextcloudApp!<BaseAddress>+0x6ed2f1
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at SharedLibrary!<BaseAddress>+0x368a33
   at SharedLibrary!<BaseAddress>+0x369031
   at SharedLibrary!<BaseAddress>+0x369b49
   at SharedLibrary!<BaseAddress>+0x3f39af
   at NextcloudApp!<BaseAddress>+0x6eda21
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at SharedLibrary!<BaseAddress>+0x3f81d3
   at SharedLibrary!<BaseAddress>+0x3c3ae5
   at SharedLibrary!<BaseAddress>+0x3c3a7d
]
[InnerException]:[]