diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2026-05-06 21:46:21 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2026-05-06 21:46:21 +0300 |
| commit | 713ced9c68cd70a8e56e8ce5ed27cb9bbe3e55c4 (patch) | |
| tree | 29f9997386b9f46db9f263ef63a5e01ca19db393 /src/middleware.ts | |
| parent | cba8c3d49b53702a488eaff16109e29e49d94b6d (diff) | |
Add shopping list features, rework
Diffstat (limited to 'src/middleware.ts')
| -rw-r--r-- | src/middleware.ts | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/middleware.ts b/src/middleware.ts index 589022f..6c56352 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1,11 +1,5 @@ /** * Telegram-only middleware utilities. - * - * HTTP server functionality has been removed, so any HTTP-specific middleware - * (e.g. header-based auth) has been deleted. - * - * This module currently exposes: - * tgAuth - Ensures that only permitted Telegram user IDs can invoke bot commands. */ import { Context } from "telegraf"; @@ -25,7 +19,7 @@ export const tgAuth = async ( ctx: Context, next: () => Promise<void>, ): Promise<void> => { - const userId = ctx.message?.from.id; + const userId = ctx.from?.id; if (!userId) { await ctx.reply("Käyttäjätunnusta ei voitu lukea (user id puuttuu)."); return; @@ -43,6 +37,6 @@ export const tgAuth = async ( await next(); } catch (err) { console.error("[tgAuth] Authorization check failed:", err); - await ctx.reply("Odottamaton virhe valtuutuksessa."); + await ctx.reply("Odottamaton virhe luvituksessa."); } }; |
