Commit 26d694c5 authored by owlo's avatar owlo

LOGGING THE HECK IN

parent e26b9fdf
No preview for this file type
......@@ -21,7 +21,7 @@ import (
var hostname string
func validateLogin(signature string, file []byte) bool {
func validateLogin(signature string, file []byte, actors []libs.ActorS) bool {
if signature != "" {
bufferedReader, err := os.Create("tests/florp")
......@@ -43,10 +43,15 @@ func validateLogin(signature string, file []byte) bool {
for florpScanner.Scan() {
fmt.Println(florpScanner.Text())
if florpScanner.Text() == signature {
fmt.Println("LOGGED THE HECK IN")
florptext := strings.Split(florpScanner.Text(), ":")
createUser(florptext[0], florptext[1])
return true
for i := range actors {
if florptext[0] == actors[i].PreferredUsername {
if florptext[1] == actors[i].Password {
fmt.Println("LOGGED THE HECK IN")
return true
}
}
}
}
}
......@@ -457,7 +462,7 @@ func main() {
if err != nil {
fmt.Println(err)
}
ok := validateLogin(signed, []byte(signature))
ok := validateLogin(signed, []byte(signature), initializedActors)
if ok {
w.Header().Set("Authorization", "ok")
w.WriteHeader(http.StatusOK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment