1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Telegram login improvements

This commit is contained in:
Steffo 2019-08-03 12:28:27 +02:00
parent 92343183c5
commit 02d1419204
6 changed files with 46 additions and 19 deletions

View file

@ -16,8 +16,8 @@ rp = Royalprint("tglogin", __name__, url_prefix="/login/telegram", required_tabl
@rp.route("/")
def tglogin_index():
if f.request.url_root != "https://ryg.steffo.eu/":
return error(404, "Il login tramite Telegram non è possibile su questo dominio.")
#if f.request.url_root != "https://ryg.steffo.eu/":
# return error(404, "Il login tramite Telegram non è possibile su questo dominio.")
f.session.pop("royal", None)
return f.render_template("tglogin_index.html")

View file

@ -12,6 +12,13 @@
</span>
</div>
<div class="dbox-bot">
<div class="center tg-login-container">
<script async src="https://telegram.org/js/telegram-widget.js?6" data-telegram-login="royalgamesbot" data-size="large" data-auth-url="{{ url_for("tglogin.tglogin_done") }}" data-request-access="write"></script>
</div>
<p>
Per fare il login, devi aver <code>sync</code>ato il tuo account sul gruppo Telegram Royal Games!
</p>
<div class="tiny">
<p>
Facendo il login su questo sito, acconsenti a ricevere due <abbr title="cookie">biscottini</abbr> che memorizzino l'account con cui hai fatto il login.<br>
</p>
@ -26,12 +33,7 @@
}
session["login_date"] = [la data e l'ora di adesso]</code></pre>
<p>
<script async src="https://telegram.org/js/telegram-widget.js?6" data-telegram-login="royalgamesbot" data-size="large" data-auth-url="{{ url_for("tglogin.tglogin_done") }}" data-request-access="write"></script>
</p>
<p>
Nota: per fare il login, devi aver <code>sync</code>ato il tuo account sul gruppo Telegram Royal Games!
</p>
</div>
</div>
</div>
{% endblock %}

View file

@ -336,6 +336,13 @@ form.full label.label-big * {
.disabled {
opacity: 0.3;
}
/*** Modifiers ***/
.tiny {
font-size: xx-small;
}
.center {
margin: auto;
}
/*** Custom elements ***/
.CodeMirror {
font-family: "Consolas", monospace !important;
@ -751,4 +758,8 @@ form.full label.label-big * {
.profile .profile-stats .stats-value {
font-weight: bold;
}
.tg-login-container {
width: 238px;
height: 40px;
}
/*# sourceMappingURL=ryg.css.map */

File diff suppressed because one or more lines are too long

View file

@ -418,6 +418,15 @@ form.full {
}
/*** Modifiers ***/
.tiny {
font-size: xx-small;
}
.center {
margin: auto;
}
/*** Custom elements ***/
@ -946,3 +955,8 @@ form.full {
}
}
}
.tg-login-container {
width: 238px;
height: 40px;
}

View file

@ -46,7 +46,7 @@
</a>
{% else %}
<span class="nav-login">
<a class="no-icon" href="{{ url_for("login.login_index") }}">
<a class="no-icon" href="{{ url_for("tglogin.tglogin_index") }}">
Login
<img class="nav-image disabled" alt="" src="{{ url_for("static", filename="generic.png") }}">
</a>