mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-03 05:02:37 +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());
|
ssoHomeserverKey, Matrix.of(context).client.homeserver.toString());
|
||||||
}
|
}
|
||||||
final redirectUrl = kIsWeb
|
final redirectUrl = kIsWeb
|
||||||
? AppConfig.webBaseUrl
|
? AppConfig.webBaseUrl + '/#/'
|
||||||
: AppConfig.appOpenUrlScheme.toLowerCase() + '://login';
|
: AppConfig.appOpenUrlScheme.toLowerCase() + '://login';
|
||||||
launch(
|
launch(
|
||||||
'${Matrix.of(context).client.homeserver?.toString()}/_matrix/client/r0/login/sso/redirect/${Uri.encodeComponent(id)}?redirectUrl=${Uri.encodeQueryComponent(redirectUrl)}',
|
'${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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (Matrix.of(context).loginState != null) {
|
if (Matrix.of(context).loginState != null) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) => context.vRouter.push(
|
WidgetsBinding.instance.addPostFrameCallback(
|
||||||
|
(_) => context.vRouter.push(
|
||||||
Matrix.of(context).loginState == LoginState.logged
|
Matrix.of(context).loginState == LoginState.logged
|
||||||
? '/rooms'
|
? '/rooms'
|
||||||
: '/home'));
|
: '/home',
|
||||||
|
queryParameters: VRouter.of(context).queryParameters,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return Scaffold(body: Center(child: CircularProgressIndicator()));
|
return Scaffold(body: Center(child: CircularProgressIndicator()));
|
||||||
}
|
}
|
||||||
|
@ -330,8 +330,10 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
.contains(widget.router.currentState.url);
|
.contains(widget.router.currentState.url);
|
||||||
if (widget.router.currentState.url == '/' ||
|
if (widget.router.currentState.url == '/' ||
|
||||||
(state == LoginState.logged) == isInLoginRoutes) {
|
(state == LoginState.logged) == isInLoginRoutes) {
|
||||||
widget.router.currentState
|
widget.router.currentState.push(
|
||||||
.push(loginState == LoginState.logged ? '/rooms' : '/home');
|
loginState == LoginState.logged ? '/rooms' : '/home',
|
||||||
|
queryParameters: widget.router.currentState.queryParameters,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user