-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sprint8 #3
base: main
Are you sure you want to change the base?
Sprint8 #3
Conversation
frontend/.env
Outdated
@@ -1,4 +1,4 @@ | |||
REACT_APP_API_URL=http://localhost:8000 | |||
REACT_APP_KEYCLOAK_URL=http://localhost:8080 | |||
REACT_APP_API_URL=http://192.168.68.104:8090 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут хардкод айпишников, так лучше не делать
keycloak/realm-export.json
Outdated
@@ -114,8 +114,8 @@ | |||
"clientId": "reports-frontend", | |||
"enabled": true, | |||
"publicClient": true, | |||
"redirectUris": ["http://localhost:3000/*"], | |||
"webOrigins": ["http://localhost:3000"], | |||
"redirectUris": ["http://192.168.68.104:3000/*"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут тоже
Remove real IP from it
Remove real IP
Убрал IP адреса. Мой смуззи ноут не тянет docker, пришлось поднимать еще машины =) |
API/main.go
Outdated
router := gin.Default() | ||
router.Use(ginkeycloak.RequestLogger([]string{"uid"}, "data")) | ||
router.Use(gin.Recovery()) | ||
router.Use(cors.Default()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут используется cors.Default().
В Default Authorization header запрещён https://github.com/gin-contrib/cors/blob/master/cors.go#L179
В итоге при авторизации через protheric1 и скачивании отчёта, ловлю следующую ошибку:
"Access to fetch at 'http://localhost:8090/reports/' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response."
Нужно поправить cors
Выполнил все задания спринта