try parsing match first

This commit is contained in:
2022-02-01 02:31:00 +01:00
parent 26c5e0558c
commit c822ce9396
2 changed files with 11 additions and 6 deletions

View File

@@ -476,7 +476,7 @@ func IsAuthCodeValid(player *ent.Player, apiKey string, shareCode string, authCo
if shareCode == "" {
tMatch, err = player.QueryMatches().Order(ent.Asc(match.FieldDate)).First(context.Background())
if err != nil {
return false, err
return false, SharecodeNoMatchError{errors.New("sharecode not provided")}
}
_, err := getNextShareCode(tMatch.ShareCode, apiKey, authCode, player.ID, rl)