This commit is contained in:
Jannover5000r 2025-06-16 23:11:42 +02:00
parent 037cdbbcaf
commit d8d1fc3679
2 changed files with 13 additions and 11 deletions

View file

@ -44,13 +44,15 @@ func Auth() {
}
log.Println("Run")
res, err := http.Post(Url, "application/json", login)
LoginOut, err := http.Post(Url, "application/json", login)
if err != nil {
log.Printf("Error during authentication: %v", err)
return
}
log.Println(res)
log.Println("")
defer LoginOut.Body.Close()
out := LoginOut.Header.Values("Set-Cookie")
log.Println(out)
}

View file

@ -9,8 +9,8 @@ import (
"net/http"
"os"
// "os/signal"
// "syscall"
"os/signal"
"syscall"
"time"
Untis "untislogger/Bot"
@ -45,14 +45,14 @@ func init() {
func main() {
go Untis.Auth() //starting API calls function
// Create a channel to receive OS signals
/* sigChan := make(chan os.Signal, 1)
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
log.Println("Program is running. Press Ctrl+C to stop.")
// Block until we receive a signal
<-sigChan
log.Println("Shutting down...") */
log.Println("Shutting down...")
}
func testPubIP() {