Merge pull request #1058 from AppFlowy-IO/gotrue-admin-creation-2
fix: gotrue admin creation without email verification
This commit is contained in:
commit
ee2ff899a3
|
|
@ -132,6 +132,12 @@ jobs:
|
||||||
echo "Running tests for ${{ matrix.test_service }} with flags: ${{ matrix.test_cmd }}"
|
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 }}
|
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
|
- name: Docker Logs
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
|
|
@ -15,3 +15,4 @@
|
||||||
- Go to [web server](localhost)
|
- Go to [web server](localhost)
|
||||||
- After editing source files, do `docker compose up -d --no-deps --build admin_frontend`
|
- 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
|
- You might need to add `--force-recreate` flag for non build changes to take effect
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ impl AdminFrontendClient {
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
let resp = check_resp(resp).await;
|
||||||
let c = resp.cookies().find(|c| c.name() == "session_id").unwrap();
|
let c = resp.cookies().find(|c| c.name() == "session_id").unwrap();
|
||||||
self.session_id = Some(c.value().to_string());
|
self.session_id = Some(c.value().to_string());
|
||||||
}
|
}
|
||||||
|
|
@ -84,3 +85,12 @@ impl AdminFrontendClient {
|
||||||
self.session_id.as_ref().unwrap()
|
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
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ set -e
|
||||||
if [ -n "${GOTRUE_ADMIN_EMAIL}" ] && [ -n "${GOTRUE_ADMIN_PASSWORD}" ]; then
|
if [ -n "${GOTRUE_ADMIN_EMAIL}" ] && [ -n "${GOTRUE_ADMIN_PASSWORD}" ]; then
|
||||||
set +e
|
set +e
|
||||||
echo "Creating admin user for gotrue..."
|
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=$?
|
command_status=$?
|
||||||
# Check if the command failed
|
# Check if the command failed
|
||||||
if [ $command_status -ne 0 ]; then
|
if [ $command_status -ne 0 ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue