fix(paramètres): le champ d'invitation n'est plus pris pour un login (1Password iOS)Unverified
23ab955 parent: 6183065 modified
src/routes/teams.rs +4 -2 | @@ -152,7 +152,9 @@ pub async fn team_leave( | ||
| 152 | 152 | |
| 153 | 153 | #[derive(Deserialize)] |
| 154 | 154 | pub struct InviteForm { |
| 155 | - username: String, | |
| 155 | + /// Pas nommé « username » : les gestionnaires de mots de passe prendraient | |
| 156 | + /// le champ pour un formulaire de connexion (interface 1Password sur iOS). | |
| 157 | + invite: String, | |
| 156 | 158 | csrf: String, |
| 157 | 159 | } |
| 158 | 160 | |
| @@ -166,7 +168,7 @@ pub async fn invite_create( | ||
| 166 | 168 | if !ctx.user.check_csrf(&state, &form.csrf) { |
| 167 | 169 | return Err(AppError::Csrf); |
| 168 | 170 | } |
| 169 | - let username = form.username.trim(); | |
| 171 | + let username = form.invite.trim(); | |
| 170 | 172 | let enc = urlenc(username); |
| 171 | 173 | let Some(target) = users::find_by_username(&state.pool, username).await? else { |
| 172 | 174 | return Ok(Redirect::to(&format!("/parametres?err=inconnu&nom={enc}"))); |
| @@ -152,7 +152,9 @@ pub async fn team_leave( | |||
| 152 | 152 | ||
| 153 | #[derive(Deserialize)] | 153 | #[derive(Deserialize)] |
| 154 | pub struct InviteForm { | 154 | pub struct InviteForm { |
| 155 | - username: String, | 155 | + /// Pas nommé « username » : les gestionnaires de mots de passe prendraient |
| 156 | + /// le champ pour un formulaire de connexion (interface 1Password sur iOS). | ||
| 157 | + invite: String, | ||
| 156 | csrf: String, | 158 | csrf: String, |
| 157 | } | 159 | } |
| 158 | 160 | ||
| @@ -166,7 +168,7 @@ pub async fn invite_create( | |||
| 166 | if !ctx.user.check_csrf(&state, &form.csrf) { | 168 | if !ctx.user.check_csrf(&state, &form.csrf) { |
| 167 | return Err(AppError::Csrf); | 169 | return Err(AppError::Csrf); |
| 168 | } | 170 | } |
| 169 | - let username = form.username.trim(); | 171 | + let username = form.invite.trim(); |
| 170 | let enc = urlenc(username); | 172 | let enc = urlenc(username); |
| 171 | let Some(target) = users::find_by_username(&state.pool, username).await? else { | 173 | let Some(target) = users::find_by_username(&state.pool, username).await? else { |
| 172 | return Ok(Redirect::to(&format!("/parametres?err=inconnu&nom={enc}"))); | 174 | return Ok(Redirect::to(&format!("/parametres?err=inconnu&nom={enc}"))); |
modified
templates/settings.html +1 -1 | @@ -70,7 +70,7 @@ | ||
| 70 | 70 | <div class="field" style="margin-bottom:var(--space-2)"> |
| 71 | 71 | <label for="invite-nom">Inviter un utilisateur</label> |
| 72 | 72 | <div style="display:flex;gap:var(--space-2)"> |
| 73 | - <input class="input" id="invite-nom" name="username" placeholder="identifiant" autocapitalize="none" autocorrect="off" required style="flex:1;min-height:44px"> | |
| 73 | + <input class="input" id="invite-nom" name="invite" placeholder="identifiant" autocapitalize="none" autocorrect="off" autocomplete="off" data-1p-ignore required style="flex:1;min-height:44px"> | |
| 74 | 74 | <button type="submit" class="btn btn-primary" style="min-height:44px">Inviter</button> |
| 75 | 75 | </div> |
| 76 | 76 | </div> |
| @@ -70,7 +70,7 @@ | |||
| 70 | <div class="field" style="margin-bottom:var(--space-2)"> | 70 | <div class="field" style="margin-bottom:var(--space-2)"> |
| 71 | <label for="invite-nom">Inviter un utilisateur</label> | 71 | <label for="invite-nom">Inviter un utilisateur</label> |
| 72 | <div style="display:flex;gap:var(--space-2)"> | 72 | <div style="display:flex;gap:var(--space-2)"> |
| 73 | - <input class="input" id="invite-nom" name="username" placeholder="identifiant" autocapitalize="none" autocorrect="off" required style="flex:1;min-height:44px"> | 73 | + <input class="input" id="invite-nom" name="invite" placeholder="identifiant" autocapitalize="none" autocorrect="off" autocomplete="off" data-1p-ignore required style="flex:1;min-height:44px"> |
| 74 | <button type="submit" class="btn btn-primary" style="min-height:44px">Inviter</button> | 74 | <button type="submit" class="btn btn-primary" style="min-height:44px">Inviter</button> |
| 75 | </div> | 75 | </div> |
| 76 | </div> | 76 | </div> |