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

Backend i Frontend - Logowanie i rejestracja z tokenami #75

Closed
Karol-2 opened this issue Nov 9, 2023 · 0 comments · Fixed by #108
Closed

Backend i Frontend - Logowanie i rejestracja z tokenami #75

Karol-2 opened this issue Nov 9, 2023 · 0 comments · Fixed by #108
Assignees

Comments

@Karol-2
Copy link
Owner

Karol-2 commented Nov 9, 2023

Ma to działać według tego schematu:

Rejestracja:
Frontend:
Przechwyć dane z formularza i wyślij je na backend.

Backend: (Route na /register)
Zweryfikuj, czy email jest unikalny.
Zabezpiecz hasło, np. poprzez hashowanie. (biblioteka bcrypt) (ewentualnie pominąć ten punkt)
Stwórz nowego użytkownika w bazie danych.
Wygeneruj JWT dla tego użytkownika.

Frontend:
Otrzymany token z backendu przechowaj w bezpieczny sposób, np. w ciasteczku lub lokalnym magazynie.

Logowanie:
Frontend:
Przechwyć dane z formularza i wyślij je na backend.

Backend: (Route na /login)
Sprawdź, czy istnieje użytkownik o podanym emailu.
Porównaj hasło z hasłem w bazie danych (biblioteka bcrypt). (ewentualnie pominąć ten punkt)
Jeśli dane są poprawne, wygeneruj JWT dla tego użytkownika.

Frontend:
Otrzymany token z backendu przechowaj w bezpieczny sposób, np. w ciasteczku lub lokalnym magazynie.

Użytkownika potem przechowujemy local storgae albo context

@Karol-2 Karol-2 converted this from a draft issue Nov 9, 2023
@Karol-2 Karol-2 changed the title Front i Back - zrobienie bardziej bezpiecznego logowania (opis) Front i Back - Bardziej bezpieczne logowanie (opis) Nov 9, 2023
@Karol-2 Karol-2 changed the title Front i Back - Bardziej bezpieczne logowanie (opis) Front i Back - Logowanie z tokenami Nov 12, 2023
@Karol-2 Karol-2 changed the title Front i Back - Logowanie z tokenami Backend i Frontend - Logowanie z tokenami Nov 12, 2023
@Karol-2 Karol-2 changed the title Backend i Frontend - Logowanie z tokenami Backend i Frontend - Logowanie i rejestracja z tokenami Nov 12, 2023
@Karol-2 Karol-2 moved this from 🆕 New to 📋 To Do in Projekt Zespołowy - Mercury Project Nov 13, 2023
@Karol-2 Karol-2 moved this from 📋 To Do to 🏗 In progress in Projekt Zespołowy - Mercury Project Nov 23, 2023
@gf-rog gf-rog linked a pull request Dec 6, 2023 that will close this issue
@Karol-2 Karol-2 moved this from 🏗 In progress to ✅ Done in Projekt Zespołowy - Mercury Project Dec 10, 2023
@Karol-2 Karol-2 closed this as completed Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

3 participants