summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/integrations/Single-Sign-On/GitHub-Enterprise.md (renamed from doc/integrations/Single-Sign-On/Github.md)0
-rw-r--r--doc/integrations/Single-Sign-On/GitHub.md24
-rw-r--r--web/react/utils/utils.jsx22
3 files changed, 37 insertions, 9 deletions
diff --git a/doc/integrations/Single-Sign-On/Github.md b/doc/integrations/Single-Sign-On/GitHub-Enterprise.md
index 6f6633846..6f6633846 100644
--- a/doc/integrations/Single-Sign-On/Github.md
+++ b/doc/integrations/Single-Sign-On/GitHub-Enterprise.md
diff --git a/doc/integrations/Single-Sign-On/GitHub.md b/doc/integrations/Single-Sign-On/GitHub.md
new file mode 100644
index 000000000..56e2d1c72
--- /dev/null
+++ b/doc/integrations/Single-Sign-On/GitHub.md
@@ -0,0 +1,24 @@
+## Configuring GitHub Single-Sign-On (unofficial)
+
+Note: Because the authentication interface of GitHub is similar to that of GitLab, the GitLab SSO feature can be used to unofficially also support GitHub SSO.
+
+Follow these steps to configure Mattermost to use Github as a single-sign-on (SSO) service for team creation, account creation and sign-in using the GitLab SSO interface.
+
+1. Login to your GitHub account and go to the Applications section in Profile Settings.
+2. Add a new application called "Mattermost" with the following as Authorization callback URL:
+ * `<your-mattermost-url>` (example: http://localhost:8065)
+
+3. Submit the application and copy the given _Id_ and _Secret_ into the appropriate _GitLabSettings_ fields in config/config.json
+
+4. Also in config/config.json, set _Enable_ to `true` for the _gitlab_ section, leave _Scope_ blank and use the following for the endpoints:
+ * _AuthEndpoint_: `https://github.com/login/oauth/authorize`
+ * _TokenEndpoint_: `https://github.com/login/oauth/access_token`
+ * _UserApiEndpoint_: `https://api.github.com/user`
+
+6. (Optional) If you would like to force all users to sign-up with GitHub only,
+in the _ServiceSettings_ section of config/config.json set _DisableEmailSignUp_
+to `true`.
+
+6. Restart your Mattermost server to see the changes take effect.
+
+7. Tell the users to set their public email for GitHub at the [Public profile page](https://github.com/settings/profile). Mattermost uses the email to create account.
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 788d8a45c..0a52f5b37 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -695,15 +695,19 @@ export function applyTheme(theme) {
}
export function applyFont(fontName) {
- const body = document.querySelector('body');
- const keys = Object.getOwnPropertyNames(body.classList);
- keys.forEach((k) => {
- const className = body.classList[k];
- if (className && className.lastIndexOf('font') === 0) {
- body.classList.remove(className);
+ const body = $('body');
+
+ for (const key of Reflect.ownKeys(Constants.FONTS)) {
+ const className = Constants.FONTS[key];
+
+ if (fontName === key) {
+ if (!body.hasClass(className)) {
+ body.addClass(className);
+ }
+ } else {
+ body.removeClass(className);
}
- });
- body.classList.add(Constants.FONTS[fontName]);
+ }
}
export function changeCss(className, classValue, classRepeat) {
@@ -1238,4 +1242,4 @@ export function getPostTerm(post) {
export function isFeatureEnabled(feature) {
return PreferenceStore.getPreference(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, Constants.FeatureTogglePrefix + feature.label, {value: 'false'}).value === 'true';
-} \ No newline at end of file
+}