remove bot-tonconnect, fix auth last_use

This commit is contained in:
user 2024-09-15 22:44:17 +03:00
parent c4c373809a
commit e927ea2b6d
4 changed files with 10 additions and 9 deletions

View File

@ -99,6 +99,9 @@ async def s_api_v1_auth_twa(request):
)
))).scalars().first()
known_user.last_use = datetime.now()
request.ctx.db_session.commit()
return response.json({
'user': known_user.json_format(),
'connected_wallet': ton_connection.json_format() if ton_connection else None,

View File

@ -15,7 +15,7 @@ async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs):
chat_wrap, user.translated('home_menu').format(
wallet_address=(
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),
), keyboard=get_inline_keyboard([
@ -26,7 +26,7 @@ async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs):
[{
'text': user.translated('disconnectWallet_button'),
'callback_data': 'disconnectWallet'
}]
}] if wallet_connection else []
]), **kwargs
)

View File

@ -15,7 +15,7 @@ main_router = Router()
async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs):
return await tg_process_template(
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),
), keyboard=get_inline_keyboard([
[{
@ -25,7 +25,7 @@ async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs):
[{
'text': user.translated('disconnectWallet_button'),
'callback_data': 'disconnectWallet'
}]
}] if wallet_connection else []
]), **kwargs
)
@ -70,8 +70,8 @@ async def t_home_menu(__msg, **extra):
WalletConnection.invalidated == False
).first()
if not wallet_connection:
return await send_connect_wallets_list(db_session, chat_wrap, user, message_id=message_id)
# if not wallet_connection:
# return await send_connect_wallets_list(db_session, chat_wrap, user, message_id=message_id)
args = []
if isinstance(__msg, types.Message):

View File

@ -11,8 +11,6 @@ UPLOADS_DIR = os.getenv('UPLOADS_DIR', '/app/data')
if not os.path.exists(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')
assert TELEGRAM_API_KEY, "Telegram API_KEY required"
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"
WEB_APP_URLS = {
'uploadContent': f"https://music-ui.letsw.app/uploadContent"
'uploadContent': f"https://web2-client.vercel.app/uploadContent"
}
ALLOWED_CONTENT_TYPES = [