feat(auth): bouton Connexion avec LinkedIn sur connexion/inscription (#88)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Colin Maudry
2026-06-24 23:18:41 +02:00
parent 9f10f1c4de
commit aac3753226
3 changed files with 42 additions and 0 deletions
+13
View File
@@ -14,6 +14,8 @@ register_page(
ERROR_MESSAGES = {
"invalid_credentials": "Identifiants invalides.",
"email_not_verified": "Vérifiez d'abord votre adresse email (consultez votre boîte de réception).",
"oauth_cancelled": "Connexion LinkedIn annulée.",
"oauth_failed": "Échec de la connexion via LinkedIn. Réessayez.",
}
INFO_MESSAGES = {
@@ -26,6 +28,15 @@ INFO_MESSAGES = {
}
def linkedin_button():
return html.A(
"Connexion avec LinkedIn",
href="/auth/linkedin",
className="btn w-100 mb-2",
style={"backgroundColor": "rgb(10, 102, 194)", "color": "white"},
)
def layout(error: str | None = None, email: str | None = None, **kwargs):
alerts = []
if error and error in ERROR_MESSAGES:
@@ -70,6 +81,8 @@ def layout(error: str | None = None, email: str | None = None, **kwargs):
dbc.Button("Se connecter", type="submit", color="primary"),
],
),
html.Div("ou", className="text-center text-muted my-2"),
linkedin_button(),
html.Hr(),
html.Div(
[
+4
View File
@@ -1,6 +1,8 @@
import dash_bootstrap_components as dbc
from dash import dcc, html, register_page
from src.pages.connexion import linkedin_button
NAME = "Inscription"
register_page(
@@ -67,6 +69,8 @@ def layout(error: str | None = None, email: str | None = None, **_):
dbc.Button("Créer le compte", type="submit", color="primary"),
],
),
html.Div("ou", className="text-center text-muted my-2"),
linkedin_button(),
html.Hr(),
dcc.Link("Déjà un compte ? Se connecter", href="/connexion"),
],