testing | dont be recursive for external domains | finalize oauth #5

Merged
simponic merged 24 commits from dont-be-authoritative into main 2024-04-06 15:43:19 -04:00
1 changed files with 3 additions and 1 deletions
Showing only changes of commit 657be66948 - Show all commits

View File

@ -259,11 +259,13 @@ func getOauthUser(dbConn *sql.DB, client *http.Client, uri string) (*database.Us
} }
func createUserFromResponse(response *http.Response) (*database.User, error) { func createUserFromResponse(response *http.Response) (*database.User, error) {
defer response.Body.Close()
user := &database.User{ user := &database.User{
CreatedAt: time.Now(), CreatedAt: time.Now(),
} }
err := json.NewDecoder(response.Body).Decode(user) err := json.NewDecoder(response.Body).Decode(user)
defer response.Body.Close()
if err != nil { if err != nil {
log.Println(err) log.Println(err)
return nil, err return nil, err