aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/auth/auth.go
blob: 6b358c3f10096d9e4cb29453ee17bff40726c834 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package auth

import (
	"context"
	"fmt"

	"github.com/nsfisis/iosdc-2024-albatross/backend/db"
)

func Login(ctx context.Context, queries *db.Queries, username, password string) (int, error) {
	userAuth, err := queries.GetUserAuthByUsername(ctx, username)
	if err != nil {
		return 0, err
	}
	if userAuth.AuthType == "bypass" {
		return int(userAuth.UserID), nil
	}
	return 0, fmt.Errorf("not implemented")
}