|
@@ -1,5 +1,5 @@
|
|
|
import { __ } from 'i18n';
|
|
|
-import { _converse } from '@converse/headless';
|
|
|
+import { _converse, api } from '@converse/headless';
|
|
|
|
|
|
/**
|
|
|
* @param {string} stat
|
|
@@ -27,14 +27,11 @@ export function getPrettyStatus(stat) {
|
|
|
export function shouldShowPasswordResetForm() {
|
|
|
const conn = _converse.api.connection.get();
|
|
|
const mechanism = conn._sasl_mechanism;
|
|
|
- if (
|
|
|
- mechanism.mechname === 'EXTERNAL' ||
|
|
|
- mechanism.mechname === 'ANONYMOUS' ||
|
|
|
- mechanism.mechname === 'X-OAUTH2' ||
|
|
|
- mechanism.mechname === 'OAUTHBEARER'
|
|
|
- ) {
|
|
|
+ if (mechanism && ['EXTERNAL', 'ANONYMOUS', 'X-OAUTH2', 'OAUTHBEARER'].includes[mechanism.mechname]) {
|
|
|
+ return false;
|
|
|
+ } else if (['external', 'anonymous'].includes(api.settings.get('authentication'))) {
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
-
|