Compare commits

...

2 Commits

Author SHA1 Message Date
d45d958ea1
fix: oauth: login: unify POST method 2024-01-05 15:08:38 +08:00
2fe58482db
chore: import.sh: read config from env 2024-01-05 15:03:04 +08:00
2 changed files with 28 additions and 13 deletions

View File

@ -55,7 +55,7 @@ func RouteRegister(rg *gin.RouterGroup, i *do.Injector) {
Scopes: []string{oidc.ScopeOpenID, "profile", "email", "roles"},
}
rg.GET("/login", app.LoginHandler())
rg.POST("/login", app.LoginHandler())
rg.GET("/callback", app.CallbackHandler())
}

View File

@ -3,22 +3,37 @@
WORKSPACE=$(cd "$(dirname "$0")"/.. && pwd)
. "$WORKSPACE"/scripts/common.sh
read -p "Enter HTTP API Endpoint: " -r endpoint
if [ -z "$endpoint" ]; then
log_error "[-] HTTP API Endpoint cannot be empty"
exit 1
if [ -z "$WOJ_ENDPOINT" ]; then
read -p "Enter HTTP API Endpoint: " -r endpoint
if [ -z "$endpoint" ]; then
log_error "[-] HTTP API Endpoint cannot be empty"
exit 1
fi
else
endpoint="$WOJ_ENDPOINT"
log_info "[*] Using HTTP API Endpoint: $endpoint"
fi
read -p "Enter Token: " -r token
if [ -z "$token" ]; then
log_error "[-] Token cannot be empty"
exit 1
if [ -z "$WOJ_TOKEN" ]; then
read -p "Enter Token: " -r token
if [ -z "$token" ]; then
log_error "[-] Token cannot be empty"
exit 1
fi
else
token="$WOJ_TOKEN"
log_info "[*] Using Token: $token"
fi
read -p "Enter Directory: " -r directory
if [ ! -d "$directory" ]; then
log_error "[-] Not a Directory"
exit 1
if [ -z "$WOJ_DIR" ]; then
read -p "Enter Directory: " -r directory
if [ ! -d "$directory" ]; then
log_error "[-] Not a Directory"
exit 1
fi
else
directory="$WOJ_DIR"
log_info "[*] Using Directory: $directory"
fi
for problem in "$directory/"*; do