2 releases
0.2.0 |
|
---|---|
0.1.1 | Aug 6, 2024 |
0.1.0 | Jul 9, 2024 |
#484 in Authentication
73 downloads per month
8KB
150 lines
telegram-authorizer
Telegram miniapp authorizer layer for Axum.
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–20MB
~366K SLoC