diff --git a/dev.env b/dev.env index c21673b6..6dcd3b16 100644 --- a/dev.env +++ b/dev.env @@ -8,7 +8,7 @@ GOTRUE_JWT_SECRET=hello456 # user sign up will automatically be confirmed if this is set to true # if you have OAuth2 set up or smtp configured, you can set this to false # to enforce email confirmation or OAuth2 login instead -GOTRUE_MAILER_AUTOCONFIRM=true +GOTRUE_MAILER_AUTOCONFIRM=false # if you enable mail confirmation, you need to set the SMTP configuration below GOTRUE_SMTP_HOST=smtp.gmail.com diff --git a/doc/deployment.md b/doc/deployment.md index eb9d55c1..10c62920 100644 --- a/doc/deployment.md +++ b/doc/deployment.md @@ -13,6 +13,7 @@ we recommend using cloud compute services (as your host server) such as ## Software Requirements - [docker compose](https://docs.docker.com/compose) This is needed be installed in your host server +- We recommend using approach as proposed by offical docker website: [Install Docker Engine](https://docs.docker.com/engine/install/) ## Steps diff --git a/src/application.rs b/src/application.rs index a915611c..7bb70de4 100644 --- a/src/application.rs +++ b/src/application.rs @@ -231,21 +231,20 @@ async fn setup_admin_account( Err(err.into()) } }, - Ok(resp) => match resp { - gotrue_entity::dto::SignUpResponse::Authenticated(resp) => { - tracing::info!( - "Admin user already created and authenticated at {:?}", - resp.user.email_confirmed_at - ); - Ok(()) - }, - gotrue_entity::dto::SignUpResponse::NotAuthenticated(user) => match user.role.as_str() { + Ok(resp) => { + let admin_user = { + match resp { + gotrue_entity::dto::SignUpResponse::Authenticated(resp) => resp.user, + gotrue_entity::dto::SignUpResponse::NotAuthenticated(user) => user, + } + }; + match admin_user.role.as_str() { "supabase_admin" => { tracing::info!("Admin user already created and set role to supabase_admin"); Ok(()) }, _ => { - let user_id = user.id.parse::().unwrap(); + let user_id = admin_user.id.parse::().unwrap(); let result = sqlx::query( r#" UPDATE auth.users @@ -263,7 +262,7 @@ async fn setup_admin_account( Ok(()) }, - }, + } }, } }