Files
tile-server/context/2026-09-21_01-35-00_yandex-oauth-env.md
T
2026-09-21 03:53:15 +03:00

13 lines
741 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Яндекс OAuth как в please_pay_me_bot
400 `Yandex OAuth is not configured` был из-за пустых `${YANDEX_CLIENT_ID:-}` в контейнере.
Как в боте:
- плоские env `YANDEX_CLIENT_ID` / `YANDEX_CLIENT_SECRET` / `YANDEX_REDIRECT_URI` (плюс `TileServer__Yandex__*`);
- секрет только в `.env` на хосте (`.env.example` без секрета);
- SPA берёт `client_id` с `GET /api/v1/auth/providers` и сама открывает `oauth.yandex.ru/authorize`;
- обмен кода: `POST /api/v1/auth/yandex` с тем же `redirectUri`.
На сервере: скопировать `.env.example``.env`, вписать секрет, `docker compose up -d --build`.