2 releases

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

#720 in Authentication

Download history 1/week @ 2024-07-25 91/week @ 2024-08-01 38/week @ 2024-08-08 6/week @ 2024-08-15 17/week @ 2024-09-12 13/week @ 2024-09-19 28/week @ 2024-09-26 15/week @ 2024-10-03

134 downloads per month

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

~11–21MB
~365K SLoC