Skip to content

Commit

Permalink
Merge pull request #1058 from AppFlowy-IO/gotrue-admin-creation-2
Browse files Browse the repository at this point in the history
fix: gotrue admin creation without email verification
  • Loading branch information
khorshuheng authored Dec 10, 2024
2 parents ce08621 + 1dd643f commit ee2ff89
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ jobs:
echo "Running tests for ${{ matrix.test_service }} with flags: ${{ matrix.test_cmd }}"
RUST_LOG="info" DISABLE_CI_TEST_LOG="true" cargo test ${{ matrix.test_cmd }}
- name: Server Logs
if: failure()
run: |
docker ps -a
docker compose -f docker-compose-ci.yml logs
- name: Docker Logs
if: always()
run: |
Expand Down
1 change: 1 addition & 0 deletions admin_frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
- Go to [web server](localhost)
- After editing source files, do `docker compose up -d --no-deps --build admin_frontend`
- You might need to add `--force-recreate` flag for non build changes to take effect

10 changes: 10 additions & 0 deletions admin_frontend/tests/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ impl AdminFrontendClient {
.send()
.await
.unwrap();
let resp = check_resp(resp).await;
let c = resp.cookies().find(|c| c.name() == "session_id").unwrap();
self.session_id = Some(c.value().to_string());
}
Expand Down Expand Up @@ -84,3 +85,12 @@ impl AdminFrontendClient {
self.session_id.as_ref().unwrap()
}
}

async fn check_resp(resp: reqwest::Response) -> reqwest::Response {
if resp.status() != 200 {
println!("resp: {:#?}", resp);
let payload = resp.text().await.unwrap();
panic!("payload: {:#?}", payload)
}
resp
}
2 changes: 1 addition & 1 deletion docker/gotrue/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
if [ -n "${GOTRUE_ADMIN_EMAIL}" ] && [ -n "${GOTRUE_ADMIN_PASSWORD}" ]; then
set +e
echo "Creating admin user for gotrue..."
command_output=$(./auth admin createuser --admin "${GOTRUE_ADMIN_EMAIL}" "${GOTRUE_ADMIN_PASSWORD}" 2>&1)
command_output=$(./auth admin createuser --admin --confirm "${GOTRUE_ADMIN_EMAIL}" "${GOTRUE_ADMIN_PASSWORD}" 2>&1)
command_status=$?
# Check if the command failed
if [ $command_status -ne 0 ]; then
Expand Down

0 comments on commit ee2ff89

Please sign in to comment.