Using rust #2
+3
-5
@@ -1,10 +1,9 @@
|
||||
|
||||
|
||||
|
||||
use sqlx::postgres::PgPoolOptions;
|
||||
|
||||
pub async fn create_pool() -> Result<sqlx::PgPool, sqlx::Error> {
|
||||
let database_url = textsender_models::envy::environment::get_db_url().await.value;
|
||||
let database_url = textsender_models::envy::environment::get_db_url()
|
||||
.await
|
||||
.value;
|
||||
println!("Database url: {database_url}");
|
||||
|
||||
PgPoolOptions::new()
|
||||
@@ -21,4 +20,3 @@ pub async fn migrations(pool: &sqlx::PgPool) {
|
||||
.await
|
||||
.expect("Failed to run migrations");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ pub mod hashing;
|
||||
pub mod repo;
|
||||
pub mod token_stuff;
|
||||
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
// initialize tracing
|
||||
|
||||
@@ -48,4 +48,3 @@ pub async fn get_passphrase(
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,9 +82,9 @@ pub fn extract_id_from_token(key: &String, token: &String) -> Result<uuid::Uuid,
|
||||
}
|
||||
}
|
||||
|
||||
pub const APP_TOKEN_TYPE: &str = "Icarus_App";
|
||||
pub const APP_TOKEN_TYPE: &str = "Textsender_App";
|
||||
pub const APP_SUBJECT: &str = "Something random";
|
||||
pub const SERVICE_TOKEN_TYPE: &str = "Icarus_Service";
|
||||
pub const SERVICE_TOKEN_TYPE: &str = "Textsender_Service";
|
||||
pub const SERVICE_SUBJECT: &str = "Service random";
|
||||
|
||||
pub fn get_token_type(key: &String, token: &String) -> Result<String, std::io::Error> {
|
||||
|
||||
Reference in New Issue
Block a user