diff options
Diffstat (limited to 'crates/auth-service')
-rw-r--r-- | crates/auth-service/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/auth-service/src/server/routes/authorised.rs | 4 | ||||
-rw-r--r-- | crates/auth-service/src/state.rs | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/crates/auth-service/Cargo.toml b/crates/auth-service/Cargo.toml index bbbb10d..837fc8b 100644 --- a/crates/auth-service/Cargo.toml +++ b/crates/auth-service/Cargo.toml @@ -19,7 +19,7 @@ jsonwebtoken = "9.3.1" nanoid.workspace = true oauth2 = "5.0.0" reqwest = { workspace = true, features = ["json", "rustls-tls"] } -sellershut-core = { workspace = true, features = ["auth", "serde"] } +sellershut-core = { workspace = true, features = ["auth", "serde", "users"] } serde = { workspace = true, features = ["derive"] } serde_json.workspace = true sqlx = { workspace = true, features = ["macros", "migrate", "runtime-tokio", "time", "tls-rustls", "uuid"] } diff --git a/crates/auth-service/src/server/routes/authorised.rs b/crates/auth-service/src/server/routes/authorised.rs index 4d48299..2538cdc 100644 --- a/crates/auth-service/src/server/routes/authorised.rs +++ b/crates/auth-service/src/server/routes/authorised.rs @@ -9,7 +9,7 @@ use axum::{ use axum_extra::{TypedHeader, headers}; use oauth2::{AuthorizationCode, TokenResponse}; use reqwest::{StatusCode, header::SET_COOKIE}; -use sellershut_core::profile::CreateUserRequest; +use sellershut_core::users::CreateUserRequest; use serde::{Deserialize, Serialize}; use sqlx::types::uuid; use time::OffsetDateTime; @@ -215,7 +215,7 @@ pub async fn login_authorised( let cookie = format!("{SESSION_COOKIE}={session_id}; SameSite=Lax; HttpOnly; Secure; Path=/"); - let mut profile_client = state.profile_client.clone(); + let mut profile_client = state.users_client.clone(); let resp = profile_client.create_user(user_request).await?.into_inner(); let user_id = resp.temp_id; diff --git a/crates/auth-service/src/state.rs b/crates/auth-service/src/state.rs index 5905948..07bfda9 100644 --- a/crates/auth-service/src/state.rs +++ b/crates/auth-service/src/state.rs @@ -1,6 +1,6 @@ use std::{ops::Deref, sync::Arc}; -use sellershut_core::profile::profile_client::ProfileClient; +use sellershut_core::users::users_service_client::UsersServiceClient; use sqlx::PgPool; use stack_up::Configuration; use tokio::task::JoinHandle; @@ -39,7 +39,7 @@ pub struct AppState { pub discord_client: OauthClient, pub http_client: reqwest::Client, pub session_store: CachingSessionStore<MokaStore, PostgresStore>, - pub profile_client: ProfileClient<Intercepted>, + pub users_client: UsersServiceClient<Intercepted>, } impl AppState { @@ -68,7 +68,7 @@ impl AppState { .await .inspect_err(|e| error!("could not connect to profile service: {e}"))?; - let profile_client = ProfileClient::with_interceptor(channel, MyInterceptor); + let users_client = UsersServiceClient::with_interceptor(channel, MyInterceptor); Ok(( AppHandle(Arc::new(Self { @@ -77,7 +77,7 @@ impl AppState { discord_client, http_client: reqwest::Client::new(), session_store: store, - profile_client, + users_client, })), deletion_task, )) |