From 919ca3431ffd5bd5079ea8ab8d3a5d069a999626 Mon Sep 17 00:00:00 2001 From: Vaida Plankyte Date: Thu, 17 Aug 2017 10:49:19 +0100 Subject: [PATCH] config_error.html: Use render_markdown_path for error content. --- templates/zerver/config_error.html | 49 ++---------------------------- templates/zerver/github-error.md | 10 ++++++ templates/zerver/google-error.md | 11 +++++++ 3 files changed, 23 insertions(+), 47 deletions(-) create mode 100644 templates/zerver/github-error.md create mode 100644 templates/zerver/google-error.md diff --git a/templates/zerver/config_error.html b/templates/zerver/config_error.html index 279e5ae8f6..b89a386189 100644 --- a/templates/zerver/config_error.html +++ b/templates/zerver/config_error.html @@ -11,56 +11,11 @@

Configuration error


{% if google_error %} -

- You are using the Google auth backend, - but it is not properly configured. Please - check the following: -

- + {{ render_markdown_path('zerver/google-error.md', {"server_uri": server_uri, "settings_path": settings_path, "secrets_path": secrets_path}) }} {% endif %} {% if github_error %} -

- You are using the GitHub auth backend, - but it is not properly configured. Please - check the following: -

- + {{ render_markdown_path('zerver/github-error.md', {"server_uri": server_uri, "settings_path": settings_path, "secrets_path": secrets_path}) }} {% endif %}

After making your changes, remember to restart diff --git a/templates/zerver/github-error.md b/templates/zerver/github-error.md new file mode 100644 index 0000000000..608006f2dc --- /dev/null +++ b/templates/zerver/github-error.md @@ -0,0 +1,10 @@ +You are using the **GitHub auth backend**, but it is not properly +configured. Please check the following: + +You have added `{{ server_uri }}/complete/github/` as the callback URL +in the OAuth application in GitHub. You can create OAuth apps from +[GitHub's developer site](https://github.com/settings/developers). + +* You have set `SOCIAL_AUTH_GITHUB_KEY` in `{{ settings_path }}` and +`social_auth_github_secret` in `{{ secrets_path }}` with the values +from your OAuth application. diff --git a/templates/zerver/google-error.md b/templates/zerver/google-error.md new file mode 100644 index 0000000000..e63375d253 --- /dev/null +++ b/templates/zerver/google-error.md @@ -0,0 +1,11 @@ +You are using the **Google auth backend**, but it is not properly +configured. Please check the following: + +* You have created a Google Oauth2 client and enabled the Google+ API. +You can create OAuth2 apps at [the Google developer console](https://console.developers.google.com). + +* You have configured your OAuth2 client to allow redirects to your +server's Google auth URL: `{{ server_uri }}/accounts/login/google/done/`. + +* You have set `GOOGLE_OAUTH2_CLIENT_ID` in `{{ settings_path }}` and +`google_oauth2_client_secret` in `{{ secrets_path }}`.