Compare commits
1 Commits
b89d0f5aa1
...
0014789f68
| Author | SHA1 | Date | |
|---|---|---|---|
| 0014789f68 |
@@ -143,10 +143,9 @@ authenticate() {
|
||||
local token
|
||||
local http_code
|
||||
|
||||
# Try authentication with "account" field (Stalwart uses "account" not "login")
|
||||
response=$(curl -s -w "\n%{http_code}" -X POST "${API_URL}/authenticate" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"account\":\"admin\",\"password\":\"${password}\"}" 2>&1)
|
||||
# Stalwart uses Basic Authentication
|
||||
response=$(curl -s -w "\n%{http_code}" -X GET "${API_URL}/authenticate" \
|
||||
-u "admin:${password}" 2>&1)
|
||||
|
||||
http_code=$(echo "$response" | tail -n 1)
|
||||
response=$(echo "$response" | sed '$d')
|
||||
|
||||
Reference in New Issue
Block a user