Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
lokiunimore.web: Tweak stuff to make telegram login work
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffo99 committed Sep 15, 2023
1 parent 6693e48 commit 90e9228
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
8 changes: 2 additions & 6 deletions lokiunimore/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,8 @@ def TELEGRAM_BOT_TOKEN(val: str) -> str:
def TELEGRAM_BOT_USERNAME(val: str) -> str:
"""
The username of the Telegram bot to contact for registration and verification.
For example, `@uniberry_loki_bot`.
For example, `uniberry_loki_bot`.
"""
if not val.startswith("@"):
raise ValueError("Bot usernames must start with `@`")
return val


Expand Down Expand Up @@ -164,10 +162,8 @@ def TELEGRAM_PRIVATE_JOIN_LINKS(val: str) -> dict:
def TELEGRAM_HELP_ROOM_USERNAME(val: str) -> str:
"""
The group username of the public Telegram group to request assistance in, to display in various parts of the bot.
For example, `@unimore_chat_help`.
For example, `unimore_chat_help`.
"""
if not val.startswith("@"):
raise ValueError("Group usernames must start with `@`")
return val


Expand Down
2 changes: 1 addition & 1 deletion lokiunimore/web/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def page_oidc_authorize():
telegram_user.link(session=sqla_extension.session, account=local_account)
sqla_extension.session.commit()

return flask.redirect(flask.url_for("page_telegram_invite", token=telegram_token))
return flask.redirect(flask.url_for("page_telegram_link", token=telegram_token))

else:
return flask.render_template("errors/no-link.html"), 403
Expand Down
7 changes: 1 addition & 6 deletions lokiunimore/web/templates/telegram/complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@
<details>
<summary>Hai bisogno di aiuto?</summary>
<p>
Richiedi assistenza nella chat Telegram dedicata:
</p>
<p class="center xl">
<a href="https://t.me/{{ config.TELEGRAM_HELP_ROOM_USERNAME }}" class="btn">
<code>{{ config.TELEGRAM_HELP_ROOM_USERNAME }}</code>
</a>
Richiedi assistenza nella <a href="https://t.me/{{ config.TELEGRAM_HELP_ROOM_USERNAME }}">chat Telegram dedicata</a>, oppure contatta <a href="mailto:{{ config.LOKI_EMAIL }}">{{ config.LOKI_EMAIL }}</a>.
</p>
</details>
<details>
Expand Down
9 changes: 2 additions & 7 deletions lokiunimore/web/templates/telegram/verify.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,15 @@
Puoi entrare nelle <b>chat pubbliche <i>Uniberry</i></b> attraverso il seguente link:
</p>
<p class="center xl">
<a href="{{ config.TELEGRAM_PUBLIC_JOIN_LINK }}" class="btn"><code>{{ config.TELEGRAM_PUBLIC_JOIN_LINK }}</code></a>
<a href="{{ config.TELEGRAM_PUBLIC_JOIN_LINK }}" class="btn">Chat pubbliche</a>
</p>
</div>
<hr/>
<div>
<details>
<summary>Hai bisogno di aiuto?</summary>
<p>
Richiedi assistenza nella chat Telegram dedicata:
</p>
<p class="center xl">
<a href="https://t.me/{{ config.TELEGRAM_HELP_ROOM_USERNAME }}" class="btn">
<code>{{ config.TELEGRAM_HELP_ROOM_USERNAME }}</code>
</a>
Richiedi assistenza nella <a href="https://t.me/{{ config.TELEGRAM_HELP_ROOM_USERNAME }}">chat Telegram dedicata</a>, oppure contatta <a href="mailto:{{ config.LOKI_EMAIL }}">{{ config.LOKI_EMAIL }}</a>.
</p>
</details>
<details>
Expand Down

0 comments on commit 90e9228

Please sign in to comment.