- Added Google OAuth controller and service to handle authentication via Google. - Introduced DTOs for Google user and token responses. - Updated AuthService and UsersService traits to support new Google OAuth functionality. - Implemented logic to create a new user if they do not exist in the system after Google authentication. - Enhanced existing user retrieval and JWT generation upon successful login. - Added tests for Google OAuth flow, including login redirection and callback handling for both new and existing users. - Updated environment configuration to include Google OAuth credentials.
16 lines
418 B
Rust
16 lines
418 B
Rust
use axum::Router;
|
|
use imphnen_gateway::gateway_service;
|
|
use imphnen_libs::axum_init;
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
env_logger::init();
|
|
axum_init(|surrealdb_ws, surrealdb_mem| async {
|
|
let app = gateway_service(surrealdb_ws, surrealdb_mem).await;
|
|
let mut router = Router::new();
|
|
router = router.nest("/api/v1/auth", imphnen_iam::v1::auth::auth_router());
|
|
app.merge(router)
|
|
})
|
|
.await;
|
|
}
|