@@ -32,15 +32,15 @@ import { OIDCLoginMethod } from "../../matrix/login/OIDCLoginMethod.js";
3232type Options = {
3333 defaultHomeserver : string ;
3434 ready : ReadyFn ;
35- oidc ?: { state : string , code : string } ;
35+ oidc ?: SegmentType [ "oidc" ] ;
3636 loginToken ?: string ;
3737} & BaseOptions ;
3838
3939export class LoginViewModel extends ViewModel < SegmentType , Options > {
4040 private _ready : ReadyFn ;
4141 private _loginToken ?: string ;
4242 private _client : Client ;
43- private _oidc ?: { state : string , code : string } ;
43+ private _oidc ?: SegmentType [ "oidc" ] ;
4444 private _loginOptions ?: LoginOptions ;
4545 private _passwordLoginViewModel ?: PasswordLoginViewModel ;
4646 private _startSSOLoginViewModel ?: StartSSOLoginViewModel ;
@@ -139,7 +139,7 @@ export class LoginViewModel extends ViewModel<SegmentType, Options> {
139139 } ) ) ) ;
140140 this . emitChange ( "completeSSOLoginViewModel" ) ;
141141 }
142- else if ( this . _oidc ) {
142+ else if ( this . _oidc ?. success === true ) {
143143 this . _hideHomeserver = true ;
144144 this . _completeOIDCLoginViewModel = this . track ( new CompleteOIDCLoginViewModel (
145145 this . childOptions (
@@ -151,6 +151,10 @@ export class LoginViewModel extends ViewModel<SegmentType, Options> {
151151 } ) ) ) ;
152152 this . emitChange ( "completeOIDCLoginViewModel" ) ;
153153 }
154+ else if ( this . _oidc ?. success === false ) {
155+ this . _hideHomeserver = false ;
156+ this . _showError ( `Sign in failed: ${ this . _oidc . errorDescription ?? this . _oidc . error } ` ) ;
157+ }
154158 else {
155159 void this . queryHomeserver ( ) ;
156160 }
0 commit comments