mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-23 15:30:34 -04:00
Fix auth tests
This commit is contained in:
parent
953ac5ffa8
commit
af97c52e48
2
.github/workflows/auth-hurl.yml
vendored
2
.github/workflows/auth-hurl.yml
vendored
@ -49,7 +49,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
./keibi > logs &
|
./keibi > logs &
|
||||||
wget --retry-connrefused --retry-on-http-error=502 http://localhost:4568/health
|
wget --retry-connrefused --retry-on-http-error=502 http://localhost:4568/health
|
||||||
hurl --error-format long --variable host=http://localhost:4568 tests/*
|
hurl --error-format long --variable host=http://localhost:4568/auth tests/*
|
||||||
env:
|
env:
|
||||||
PGHOST: localhost
|
PGHOST: localhost
|
||||||
FIRST_USER_CLAIMS: '{"permissions": ["users.read"]}'
|
FIRST_USER_CLAIMS: '{"permissions": ["users.read"]}'
|
||||||
|
@ -56,7 +56,7 @@ func GetCurrentSessionId(c echo.Context) (uuid.UUID, error) {
|
|||||||
|
|
||||||
func CheckPermissions(c echo.Context, perms []string) error {
|
func CheckPermissions(c echo.Context, perms []string) error {
|
||||||
token, ok := c.Get("user").(*jwt.Token)
|
token, ok := c.Get("user").(*jwt.Token)
|
||||||
if !ok{
|
if !ok {
|
||||||
return echo.NewHTTPError(401, "Not logged in")
|
return echo.NewHTTPError(401, "Not logged in")
|
||||||
}
|
}
|
||||||
sub, err := token.Claims.GetSubject()
|
sub, err := token.Claims.GetSubject()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user