mirror of
https://github.com/n08i40k/schedule-parser-rusted.git
synced 2025-12-06 17:57:47 +03:00
feat!: add telegram auth and async refactor
- Removed "/schedule/update-download-url" endpoint, this mechanism was replaced by Yandex Cloud FaaS. Ура :) - Improved schedule caching mechanism. - Added Telegram WebApp authentication support. - Reworked endpoints responses and errors mechanism. - Refactored application state management. - Make synchronous database operations, middlewares and extractors to asynchronous. - Made user password field optional to support multiple auth methods. - Renamed users table column "version" to "android_version" and made it nullable.
This commit is contained in:
19
src/state/env/vk_id.rs
vendored
Normal file
19
src/state/env/vk_id.rs
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
use std::env;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct VkIdEnvData {
|
||||
pub client_id: i32,
|
||||
pub redirect_url: String,
|
||||
}
|
||||
|
||||
impl Default for VkIdEnvData {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
client_id: env::var("VK_ID_CLIENT_ID")
|
||||
.expect("VK_ID_CLIENT_ID must be set")
|
||||
.parse()
|
||||
.expect("VK_ID_CLIENT_ID must be integer"),
|
||||
redirect_url: env::var("VK_ID_REDIRECT_URI").expect("VK_ID_REDIRECT_URI must be set"),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user