Skip to content

Commit

Permalink
BANG-468: Get sign in title from settings
Browse files Browse the repository at this point in the history
  • Loading branch information
v.kuvaitsev committed Jul 23, 2024
1 parent 0dd0ec9 commit 4008310
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion auth/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
async def get_login_context(error: str | None = None) -> Dict[str, Union[str | bool]]:
use_oauth = getattr(getattr(settings, 'OAUTH', None), 'IS_USED', False)
only_oauth = getattr(getattr(settings, 'OAUTH', None), 'ONLY_OAUTH', False)
context = {'context': '', 'use_oauth': use_oauth, 'only_oauth': only_oauth}
oauth_sign_in_title = getattr(getattr(settings, 'OAUTH', None), 'SIGN_IN_TITLE', '')
context = {
'context': '',
'use_oauth': use_oauth,
'only_oauth': only_oauth,
'oauth_sign_in_title': oauth_sign_in_title,
}
if error:
context['error'] = error
return context
Expand Down
2 changes: 1 addition & 1 deletion its_on/templates/users/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h2>ITS ON</h2>
{%- endif -%}
{%- if use_oauth -%}
<div class="form-group">
<a href="/oauth/auth" class="col-sm-offset-2 btn btn-default"> Sign in with "Bestdoctor ID"</a>
<a href="/oauth/auth" class="col-sm-offset-2 btn btn-default"> {{ oauth_sign_in_title }} </a>
</div>
{%- endif -%}
{%- if error is defined -%}
Expand Down
1 change: 1 addition & 0 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ default:
client_secret: '@none'
authorize_url: '@none'
token_url: '@none'
sign_in_title: 'Sign in with "Bestdoctor ID"'
enable_db_logging: false
cache_url: redis://127.0.0.1:6379/1
cache_ttl: 300
Expand Down

0 comments on commit 4008310

Please sign in to comment.