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:
@@ -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(
|
||||
[
|
||||
|
||||
@@ -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"),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user