2 releases

0.2.0 Jul 11, 2024
0.1.1 Aug 6, 2024
0.1.0 Jul 9, 2024

#487 in Authentication

MIT license

8KB
150 lines

telegram-authorizer

Telegram miniapp authorizer layer for Axum.

Rust Crates.io

Usage

Router

...
Router::new()
    .route("/", get(login))
    .layer(telegram_authorizer::AuthorizationLayer(bot_token));`
...

Handler

use telegram_authorizer::TelegramUser;

pub async fn login(TelegramUser(id): TelegramUser) -> impl IntoResponse {
    tracing::info!("user: {:?}", id);
    ...
}

Client

One should send initData as query string.

Dependencies

~10–20MB
~369K SLoC