Fixed some debug issues commented out code

This commit is contained in:
Opaque02 2024-09-25 20:05:17 +10:00
parent 59356c9137
commit 285cf78d7a
3 changed files with 1 additions and 7 deletions

1
.gitignore vendored
View File

@ -15,4 +15,3 @@ secret.key
*.iws *.iws
.vscode/launch.json .vscode/launch.json
#local stuff

View File

@ -22,7 +22,6 @@ import (
"errors" "errors"
"net/http" "net/http"
"net/url" "net/url"
"log"
"github.com/bwmarrin/discordgo" "github.com/bwmarrin/discordgo"
) )
@ -113,8 +112,6 @@ func RetrieveDiscordId(code string) (string, error) {
} }
func IsUserDiscordAdmin(discordId string, discordGuildID string) (bool, error) { func IsUserDiscordAdmin(discordId string, discordGuildID string) (bool, error) {
return discordId == "256000469158068224", nil
// fetch all roles from discord // fetch all roles from discord
roles, err := DiscordSession.GuildRoles(discordGuildID) roles, err := DiscordSession.GuildRoles(discordGuildID)
if err != nil { if err != nil {

View File

@ -24,7 +24,6 @@ import (
"encoding/base64" "encoding/base64"
"errors" "errors"
"fmt" "fmt"
"log"
"github.com/pagefaultgames/rogueserver/db" "github.com/pagefaultgames/rogueserver/db"
) )
@ -53,8 +52,7 @@ func Login(username, password string) (LoginResponse, error) {
} }
if !bytes.Equal(key, deriveArgon2IDKey([]byte(password), salt)) { if !bytes.Equal(key, deriveArgon2IDKey([]byte(password), salt)) {
log.Printf("Hello") return response, fmt.Errorf("password doesn't match")
return response, fmt.Errorf("passworasdasdasdd doesn't match")
} }
response.Token, err = GenerateTokenForUsername(username) response.Token, err = GenerateTokenForUsername(username)