mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Test fix for telegram login
This commit is contained in:
parent
567d0e0979
commit
63047eb124
3 changed files with 24 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
from . import audio, bots, commands, database, network, utils, error, web
|
||||
|
||||
version = "5.0a16"
|
||||
version = "5.0a17"
|
||||
|
||||
__all__ = ["audio", "bots", "commands", "database", "network", "utils", "error", "web"]
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import flask as f
|
||||
import hashlib
|
||||
import hmac
|
||||
import datetime
|
||||
from ... import Royalprint
|
||||
from ....database.tables import Royal, Telegram
|
||||
|
||||
|
@ -31,5 +32,7 @@ def tglogin_done():
|
|||
if tg_user is None:
|
||||
return "No such telegram", 404
|
||||
royal_user = tg_user.royal
|
||||
f.session["royal_id"] = royal_user.id
|
||||
return f.redirect(f.url_for("/"))
|
||||
f.session["login_id"] = royal_user.id
|
||||
f.session["login_name"] = royal_user.name
|
||||
f.session["login_date"] = datetime.datetime.now()
|
||||
return f.render_template("tglogin_success.html")
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
Login with Telegram
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="doublebox">
|
||||
<div class="top">
|
||||
<span class="left">
|
||||
Telegram login
|
||||
</span>
|
||||
</div>
|
||||
<div class="bot">
|
||||
Login riuscito! Sei connesso come <b>{{ session["login_name"] }}</b>!
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in a new issue