mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-18 01:49:50 +01:00
chore: follow up of web sso fix
This commit is contained in:
parent
92e4b50955
commit
cb84e82365
@ -198,7 +198,7 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
||||
ssoHomeserverKey, Matrix.of(context).client.homeserver.toString());
|
||||
}
|
||||
final redirectUrl = kIsWeb
|
||||
? AppConfig.webBaseUrl
|
||||
? AppConfig.webBaseUrl + '/#/'
|
||||
: AppConfig.appOpenUrlScheme.toLowerCase() + '://login';
|
||||
launch(
|
||||
'${Matrix.of(context).client.homeserver?.toString()}/_matrix/client/r0/login/sso/redirect/${Uri.encodeComponent(id)}?redirectUrl=${Uri.encodeQueryComponent(redirectUrl)}',
|
||||
|
@ -7,10 +7,14 @@ class LoadingView extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (Matrix.of(context).loginState != null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => context.vRouter.push(
|
||||
WidgetsBinding.instance.addPostFrameCallback(
|
||||
(_) => context.vRouter.push(
|
||||
Matrix.of(context).loginState == LoginState.logged
|
||||
? '/rooms'
|
||||
: '/home'));
|
||||
: '/home',
|
||||
queryParameters: VRouter.of(context).queryParameters,
|
||||
),
|
||||
);
|
||||
}
|
||||
return Scaffold(body: Center(child: CircularProgressIndicator()));
|
||||
}
|
||||
|
@ -330,8 +330,10 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||
.contains(widget.router.currentState.url);
|
||||
if (widget.router.currentState.url == '/' ||
|
||||
(state == LoginState.logged) == isInLoginRoutes) {
|
||||
widget.router.currentState
|
||||
.push(loginState == LoginState.logged ? '/rooms' : '/home');
|
||||
widget.router.currentState.push(
|
||||
loginState == LoginState.logged ? '/rooms' : '/home',
|
||||
queryParameters: widget.router.currentState.queryParameters,
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user