Add sanity check for server configuration#1136
Add sanity check for server configuration#1136alexisbirling-boop wants to merge 6 commits intowger-project:masterfrom
Conversation
|
thanks for the PR! I would keep the error message as short as possible and just point users to the online docs, we can update those more easily (and describe the problem better). So something like "Server misconfiguration detected, headers are not being passed correctly, please consult the docs". I'll take a look at the rest later today. |
|
Alright, I'll start working on the changes |
|
|
||
| if (context.mounted && res == LoginActions.proceed) { | ||
| final authProvider = context.read<AuthProvider>(); | ||
| if (authProvider.serverConfigWarning) { |
There was a problem hiding this comment.
I think it would be more consistent to use something like AuthState.updateRequired here
|
|
||
| /// Checks if the server's reverse proxy is configured correctly | ||
| /// by comparing pagination URLs with the base URL domain. | ||
| Future<SanityCheckResult> checkServerPaginationUrls({ |
There was a problem hiding this comment.
I would move this to the auth provider (while it's not strictly anything to do with authentication is related enough, plus we already have the min application version check there)
| } | ||
|
|
||
| /// Result of a server sanity check | ||
| class SanityCheckResult { |
There was a problem hiding this comment.
a boolean might be enough 😄 This can be useful if we added more checks, but at the moment there's nothing planed
| builder: (context) => AlertDialog( | ||
| title: Row( | ||
| children: [ | ||
| const Icon(Icons.warning, color: Colors.orange, size: 28), |
There was a problem hiding this comment.
better use something like Theme.of(context).colorScheme.error instead of hard coding the color, then this updates automatically if we change something there
Proposed Changes
localhostinstead of actual domain)Related Issue(s)
Closes #1116
Please check that the PR fulfills these requirements
dart format .)Screenshot of the sanity check widget (while testing)