diff --git a/README.md b/README.md index 732743a..40d05a1 100644 --- a/README.md +++ b/README.md @@ -87,8 +87,8 @@ gamja default settings can be set using a `config.json` file at the root: "autojoin": "#gamja", // Controls how the password UI is presented to the user. Set to // "mandatory" to require a password, "optional" to accept one but not - // require it, and "disabled" to never ask for a password. Defaults to - // "optional". + // require it, "disabled" to never ask for a password, or "external" to + // use SASL EXTERNAL. Defaults to "optional". "auth": "optional", // Default nickname (string). "nick": "asdf", diff --git a/components/app.js b/components/app.js index d254250..4985d74 100644 --- a/components/app.js +++ b/components/app.js @@ -124,6 +124,7 @@ export default class App extends Component { realname: null, nick: null, saslPlain: null, + saslExternal: false, autoconnect: false, autojoin: [], }, @@ -207,6 +208,9 @@ export default class App extends Component { if (typeof config.server.autoconnect === "boolean") { connectParams.autoconnect = config.server.autoconnect; } + if (config.server.auth === "external") { + connectParams.saslExternal = true; + } } let autoconnect = store.autoconnect.load(); diff --git a/components/connect-form.js b/components/connect-form.js index 4f796e6..c19a8f8 100644 --- a/components/connect-form.js +++ b/components/connect-form.js @@ -61,6 +61,8 @@ export default class ConnectForm extends Component { username: params.username || params.nick, password: this.state.password, }; + } else if (this.props.auth === "external") { + params.saslExternal = true; } this.state.autojoin.split(",").forEach(function(ch) { @@ -112,7 +114,7 @@ export default class ConnectForm extends Component { } let auth = null; - if (this.props.auth !== "disabled") { + if (this.props.auth !== "disabled" && this.props.auth !== "external") { auth = html`