Thanks to visit codestin.com
Credit goes to github.com

Skip to content

catch server error 401 - Unauthorized #251

@SunboX

Description

@SunboX

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]:[]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions