Apply strictNullChecks
to src/components/auth/*
(#10484
* Apply `strictNullChecks` to `src/components/auth/*` * fix * strict types
This commit is contained in:
parent
af151700c9
commit
f152613f83
8 changed files with 25 additions and 17 deletions
|
@ -114,7 +114,7 @@ export default class SoftLogout extends React.Component<IProps, IState> {
|
|||
|
||||
private async initLogin(): Promise<void> {
|
||||
const queryParams = this.props.realQueryParams;
|
||||
const hasAllParams = queryParams && queryParams["loginToken"];
|
||||
const hasAllParams = queryParams?.["loginToken"];
|
||||
if (hasAllParams) {
|
||||
this.setState({ loginView: LoginView.Loading });
|
||||
this.trySsoLogin();
|
||||
|
@ -156,7 +156,7 @@ export default class SoftLogout extends React.Component<IProps, IState> {
|
|||
user: MatrixClientPeg.get().getUserId(),
|
||||
},
|
||||
password: this.state.password,
|
||||
device_id: MatrixClientPeg.get().getDeviceId(),
|
||||
device_id: MatrixClientPeg.get().getDeviceId() ?? undefined,
|
||||
};
|
||||
|
||||
let credentials: IMatrixClientCreds;
|
||||
|
@ -185,11 +185,17 @@ export default class SoftLogout extends React.Component<IProps, IState> {
|
|||
this.setState({ busy: true });
|
||||
|
||||
const hsUrl = localStorage.getItem(SSO_HOMESERVER_URL_KEY);
|
||||
if (!hsUrl) {
|
||||
logger.error("Homeserver URL unknown for SSO login callback");
|
||||
this.setState({ busy: false, loginView: LoginView.Unsupported });
|
||||
return;
|
||||
}
|
||||
|
||||
const isUrl = localStorage.getItem(SSO_ID_SERVER_URL_KEY) || MatrixClientPeg.get().getIdentityServerUrl();
|
||||
const loginType = "m.login.token";
|
||||
const loginParams = {
|
||||
token: this.props.realQueryParams["loginToken"],
|
||||
device_id: MatrixClientPeg.get().getDeviceId(),
|
||||
device_id: MatrixClientPeg.get().getDeviceId() ?? undefined,
|
||||
};
|
||||
|
||||
let credentials: IMatrixClientCreds;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue