szoe-pontok/database/auth/middleware.go

24 lines
373 B
Go
Raw Normal View History

2024-10-10 19:41:49 +00:00
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
}