telegram-authorizer

Crates.iotelegram-authorizer
lib.rstelegram-authorizer
version0.1.1
sourcesrc
created_at2024-07-09 14:35:55.292057
updated_at2024-08-06 15:20:12.970429
descriptionTelegram authorizer for Axum
homepage
repositoryhttps://github.com/evilbluebeaver/telegram-authorizer
max_upload_size
id1297156
size7,817
Kirill Kindiuk (evilbluebeaver)

documentation

README

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.

Commit count: 6

cargo fmt