Skip to content
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

Реализовать авторизацию на бэке #166

Closed
qelphybox opened this issue Jan 3, 2021 · 1 comment · Fixed by #185
Closed

Реализовать авторизацию на бэке #166

qelphybox opened this issue Jan 3, 2021 · 1 comment · Fixed by #185

Comments

@qelphybox
Copy link
Owner

qelphybox commented Jan 3, 2021

Нужно написать авторизацию через телеграм, тут вся полезная инфа https://core.telegram.org/widgets/login

Авторизация через callback поэтому на бэке нужно реализовать пару методов:

  1. GET /auth/callback?id=asdf&first_name=asdf&last_name=asdf&username=asdf&photo_url=asdf&auth_date=asdfhash=asdf
    1. Провалидировать запрос (https://core.telegram.org/widgets/login#checking-authorization)
    2. Если запрос валиден: Сохранить данные юзера в сессию (в куки) и редирект на Home page (304) /?auth=success
    3. Если запрос невалиден: Редирект на Home page (304) /?auth=fail
  2. GET /auth/logout
    1. Удалить из сессии данные юзера
    2. Вернуть 200 { "message": "Bye!" }

Можно сделать тестовые welcome page и home page чтобы можно было протыкать весь процесс.

@svyborov
Copy link
Collaborator

Беру.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants