24 lines
373 B
Go
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
|
||
|
}
|