Skip to content

Commit

Permalink
Read pwd reset link from settings
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Sep 8, 2023
1 parent e7d57b4 commit 54296bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/templates/app/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

{% is_single_user_mode as autologin %}
{% has_external_auth as ext_auth %}
{% reset_password_link as reset_pwd_link %}

{% if autologin %}
<script>location.href='/';</script>
Expand All @@ -24,14 +25,17 @@
<button type="submit" class="btn btn-default">{% trans 'Log in' %}</button>
</div>
<div class="top-buffer col-sm-offset-2 col-sm-10">
<!--<p><a href="{% url 'password_reset' %}">{% trans "Reset My Password" %}</a></p>-->
<p><a href="javascript:toggleForgotPasswordHint();">Forgot your password?</a></p>
{% if reset_pwd_link != '' %}
<p><a href="{{ reset_pwd_link }}">{% trans "Forgot your password?" %}</a></p>
{% else %}
<p><a href="javascript:toggleForgotPasswordHint();">{% trans "Forgot your password?" %}</a></p>
<script>function toggleForgotPasswordHint(){ $("#forgotPasswordHint").toggle(); }</script>
<div id="forgotPasswordHint" style="display: none; font-size: 90%; padding: 4px;" class="theme-secondary">
You can reset the administrator password by running the following command:
<span class="theme-background-highlight" style="padding: 4px; margin: 8px 0; display: inline-block;">./webodm.sh resetadminpassword yournewpass</span><br/>
If you used WebODM Manager to launch WebODM, find the "Reset Password" button within the maintenance panel or within one of WebODM Manager menus.
</div>
{% endif %}
</div>
</div>
</form>
Expand Down
4 changes: 4 additions & 0 deletions app/templatetags/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
register = template.Library()
logger = logging.getLogger('app.logger')

@register.simple_tag
def reset_password_link():
return settings.RESET_PASSWORD_LINK

@register.simple_tag
def has_external_auth():
return settings.EXTERNAL_AUTH_ENDPOINT != ""
Expand Down

0 comments on commit 54296bd

Please sign in to comment.