remove bot-tonconnect, fix auth last_use
This commit is contained in:
parent
c4c373809a
commit
e927ea2b6d
|
|
@ -99,6 +99,9 @@ async def s_api_v1_auth_twa(request):
|
||||||
)
|
)
|
||||||
))).scalars().first()
|
))).scalars().first()
|
||||||
|
|
||||||
|
known_user.last_use = datetime.now()
|
||||||
|
request.ctx.db_session.commit()
|
||||||
|
|
||||||
return response.json({
|
return response.json({
|
||||||
'user': known_user.json_format(),
|
'user': known_user.json_format(),
|
||||||
'connected_wallet': ton_connection.json_format() if ton_connection else None,
|
'connected_wallet': ton_connection.json_format() if ton_connection else None,
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs):
|
||||||
chat_wrap, user.translated('home_menu').format(
|
chat_wrap, user.translated('home_menu').format(
|
||||||
wallet_address=(
|
wallet_address=(
|
||||||
Address(wallet_connection.wallet_address).to_string(1, 1, 1)
|
Address(wallet_connection.wallet_address).to_string(1, 1, 1)
|
||||||
if wallet_connection else user.translated('noWalletConnected')
|
if wallet_connection else user.translated('p_walletNotConnected')
|
||||||
),
|
),
|
||||||
name=user.front_format(plain_text=True),
|
name=user.front_format(plain_text=True),
|
||||||
), keyboard=get_inline_keyboard([
|
), keyboard=get_inline_keyboard([
|
||||||
|
|
@ -26,7 +26,7 @@ async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs):
|
||||||
[{
|
[{
|
||||||
'text': user.translated('disconnectWallet_button'),
|
'text': user.translated('disconnectWallet_button'),
|
||||||
'callback_data': 'disconnectWallet'
|
'callback_data': 'disconnectWallet'
|
||||||
}]
|
}] if wallet_connection else []
|
||||||
]), **kwargs
|
]), **kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ main_router = Router()
|
||||||
async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs):
|
async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs):
|
||||||
return await tg_process_template(
|
return await tg_process_template(
|
||||||
chat_wrap, user.translated('home_menu').format(
|
chat_wrap, user.translated('home_menu').format(
|
||||||
wallet_address=Address(wallet_connection.wallet_address).to_string(1, 1, 1),
|
wallet_address=Address(wallet_connection.wallet_address).to_string(1, 1, 1) if wallet_connection else user.translated('p_walletNotConnected'),
|
||||||
name=user.front_format(plain_text=True),
|
name=user.front_format(plain_text=True),
|
||||||
), keyboard=get_inline_keyboard([
|
), keyboard=get_inline_keyboard([
|
||||||
[{
|
[{
|
||||||
|
|
@ -25,7 +25,7 @@ async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs):
|
||||||
[{
|
[{
|
||||||
'text': user.translated('disconnectWallet_button'),
|
'text': user.translated('disconnectWallet_button'),
|
||||||
'callback_data': 'disconnectWallet'
|
'callback_data': 'disconnectWallet'
|
||||||
}]
|
}] if wallet_connection else []
|
||||||
]), **kwargs
|
]), **kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -70,8 +70,8 @@ async def t_home_menu(__msg, **extra):
|
||||||
WalletConnection.invalidated == False
|
WalletConnection.invalidated == False
|
||||||
).first()
|
).first()
|
||||||
|
|
||||||
if not wallet_connection:
|
# if not wallet_connection:
|
||||||
return await send_connect_wallets_list(db_session, chat_wrap, user, message_id=message_id)
|
# return await send_connect_wallets_list(db_session, chat_wrap, user, message_id=message_id)
|
||||||
|
|
||||||
args = []
|
args = []
|
||||||
if isinstance(__msg, types.Message):
|
if isinstance(__msg, types.Message):
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ UPLOADS_DIR = os.getenv('UPLOADS_DIR', '/app/data')
|
||||||
if not os.path.exists(UPLOADS_DIR):
|
if not os.path.exists(UPLOADS_DIR):
|
||||||
os.makedirs(UPLOADS_DIR)
|
os.makedirs(UPLOADS_DIR)
|
||||||
|
|
||||||
CONFIG_FILE = os.getenv('CONFIG_FILE') or f"{UPLOADS_DIR}/../config/config"
|
|
||||||
|
|
||||||
TELEGRAM_API_KEY = os.environ.get('TELEGRAM_API_KEY')
|
TELEGRAM_API_KEY = os.environ.get('TELEGRAM_API_KEY')
|
||||||
assert TELEGRAM_API_KEY, "Telegram API_KEY required"
|
assert TELEGRAM_API_KEY, "Telegram API_KEY required"
|
||||||
CLIENT_TELEGRAM_API_KEY = os.environ.get('CLIENT_TELEGRAM_API_KEY')
|
CLIENT_TELEGRAM_API_KEY = os.environ.get('CLIENT_TELEGRAM_API_KEY')
|
||||||
|
|
@ -34,7 +32,7 @@ _now_str = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
||||||
LOG_FILEPATH = f"{LOG_DIR}/{_now_str}.log"
|
LOG_FILEPATH = f"{LOG_DIR}/{_now_str}.log"
|
||||||
|
|
||||||
WEB_APP_URLS = {
|
WEB_APP_URLS = {
|
||||||
'uploadContent': f"https://music-ui.letsw.app/uploadContent"
|
'uploadContent': f"https://web2-client.vercel.app/uploadContent"
|
||||||
}
|
}
|
||||||
|
|
||||||
ALLOWED_CONTENT_TYPES = [
|
ALLOWED_CONTENT_TYPES = [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue