szoe-pontok/database/auth/middleware.go
2024-10-10 21:41:49 +02:00

24 lines
373 B
Go

package auth
import (
"git.tek.govt.hu/dowerx/szoe-pontok/database"
"github.com/redis/go-redis/v9"
)
func LoggedIn(token string) (string, error) {
rdb, ctx := database.GetRDB()
result, err := rdb.Get(ctx, token).Result()
if err == redis.Nil {
return "", err
}
return result, nil
}
func IsAdmin(neptun string) error {
// db := database.GetDB()
return nil
}