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

[PRONOTE]: Les code pin sont là ! #239

Merged
merged 9 commits into from
Oct 1, 2024

Conversation

Gabriel29306
Copy link
Contributor

🚀 Nouvelle Pull Request

Proposez vos modifications pour améliorer Papillon

Informations importantes

Merci de vous référer à la documentation sur la contribution si vous avez des questions à propos des pull requests (https://gitbook.getpapillon.xyz/organisation/outils-internes/github)

Checklist d'avant pull request

Veuillez cocher toutes les cases applicables en remplaçant [ ] par [x].

  • Vous avez testé de build le projet avec vos modifications et ce build a réussi
  • Vous respectez les conventions de codage et de nommage du projet
  • Vous utilisez la tabulation pour l'indentation afin de maintenir un code lisible
  • Cette pull request n'est pas un duplicata d'une autre
  • Cette pull request est prête à être revue (review) et fusionnée (merge)
  • Il n'y a pas de TODO (aka des annotations pour du code manquant) dans vos modifications
  • Il n'y a pas d'erreurs de langue dans votre code (grammaire, vocabulaire, conjugaison, orthographe)
  • Les détails des changements ont été décrits ci-dessous
  • Cette pull-request n'est pas une "breaking-change" (des modifications qui vont entraîner la modification du fonctionnement de certaines fonctionnalités déjà existantes)

Changelogs proposés

L'arrivé de l'authentification par QrCode (et enregistrement de l'appareil)

Informations supplémentaires

Écran de 2FA

2024-09-29 at 12 19 33

@Louis454545
Copy link
Contributor

This pull request introduces several changes to improve the authentication flow for the Pronote service, including the addition of a new 2FA authentication screen, updates to existing components, and type enhancements. The most important changes include the creation of the Pronote2FA_Auth screen, modifications to the PronoteCredentials component to handle 2FA, and various type and state management updates.

New Features:

  • Pronote 2FA Authentication Screen:
    • Added a new screen Pronote2FA_Auth to handle two-factor authentication for Pronote users. (src/views/login/pronote/Pronote2FA_Auth.tsx)
    • Updated the router to include the new Pronote2FA_Auth screen. (src/router/screens/login/pronote.ts) [1] [2]

Enhancements to Existing Components:

  • Pronote Credentials Component:
    • Modified the PronoteCredentials component to navigate to the Pronote2FA_Auth screen if a SecurityError is encountered during login. (src/views/login/pronote/PronoteCredentials.tsx) [1] [2]
    • Added type imports and updated type definitions for better type safety. (src/views/login/pronote/PronoteCredentials.tsx)

Type and State Management Updates:

  • Type Enhancements:

    • Exported the Alert type for better type usage in components. (src/providers/AlertProvider.tsx)
    • Added new route parameters for Pronote2FA_Auth. (src/router/helpers/types.ts)
  • State Management:

    • Corrected state setter names in the LoginView component for clarity. (src/components/Templates/LoginView.tsx) [1] [2]

Minor Improvements:

  • Clipboard Handling:
    • Simplified clipboard handling logic in the PronoteManualURL component. (src/views/login/pronote/PronoteManualURL.tsx) [1] [2] [3] [4] [5]
  • Imports Cleanup:
    • Removed unused imports and added necessary type imports in various files. (src/services/pronote/determinate-authentication-view.tsx) [1] [2]

@Gabriel29306
Copy link
Contributor Author

@Louis-htmlcss ce n'était pas nécessaire

@Louis454545
Copy link
Contributor

@Louis-htmlcss ce n'était pas nécessaire

Ça m'a fait plaisir tkt

@yannouuuu
Copy link
Member

mais c'est déjà implémenté dans l'app depuis le début si je ne me trompe pas ?

QR Code Method Papillon

@Louis454545
Copy link
Contributor

mais c'est déjà implémenté dans l'app depuis le début si je ne me trompe pas ?

QR Code Method Papillon

c'est pas la meme chose je crois

@NathxnAzuur
Copy link

OUIIII ENFIIIIINNNNNNNNNNNNN 🥳🥳🥳🥳🥳 merci gabriel

@Rexxt
Copy link
Contributor

Rexxt commented Sep 29, 2024

This pull request introduces several changes to improve the authentication flow for the Pronote service, including the addition of a new 2FA authentication screen, updates to existing components, and type enhancements. The most important changes include the creation of the Pronote2FA_Auth screen, modifications to the PronoteCredentials component to handle 2FA, and various type and state management updates.

New Features:

* **Pronote 2FA Authentication Screen**:
  
  * Added a new screen `Pronote2FA_Auth` to handle two-factor authentication for Pronote users. (`src/views/login/pronote/Pronote2FA_Auth.tsx`)
  * Updated the router to include the new `Pronote2FA_Auth` screen. (`src/router/screens/login/pronote.ts`) [[1]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-83613f8f4c57bd1e358a9ef72dae5b595ca3cf1d94d0299b28b1e762770ec20eR12) [[2]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-83613f8f4c57bd1e358a9ef72dae5b595ca3cf1d94d0299b28b1e762770ec20eR60-R63)

Enhancements to Existing Components:

* **Pronote Credentials Component**:
  
  * Modified the `PronoteCredentials` component to navigate to the `Pronote2FA_Auth` screen if a `SecurityError` is encountered during login. (`src/views/login/pronote/PronoteCredentials.tsx`) [[1]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-675bfb813e523a874eef7ec8ba44d3704474f2b19e9b9de1c96348ae8926429bR35-R52) [[2]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-675bfb813e523a874eef7ec8ba44d3704474f2b19e9b9de1c96348ae8926429bL88-L89)
  * Added type imports and updated type definitions for better type safety. (`src/views/login/pronote/PronoteCredentials.tsx`)

Type and State Management Updates:

* **Type Enhancements**:
  
  * Exported the `Alert` type for better type usage in components. (`src/providers/AlertProvider.tsx`)
  * Added new route parameters for `Pronote2FA_Auth`. (`src/router/helpers/types.ts`)

* **State Management**:
  
  * Corrected state setter names in the `LoginView` component for clarity. (`src/components/Templates/LoginView.tsx`) [[1]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-af7aab36cb3eb612e1f267c66614ce98b494764413b50f2d4e6fdb3d19b04939L59-R59) [[2]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-af7aab36cb3eb612e1f267c66614ce98b494764413b50f2d4e6fdb3d19b04939L217-R217)

Minor Improvements:

* **Clipboard Handling**:
  
  * Simplified clipboard handling logic in the `PronoteManualURL` component. (`src/views/login/pronote/PronoteManualURL.tsx`) [[1]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-5be427473d2ceb7680f9053320d22cf1aec0427c8eeab788a192c48d27923e3aL3-R3) [[2]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-5be427473d2ceb7680f9053320d22cf1aec0427c8eeab788a192c48d27923e3aL36-L45) [[3]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-5be427473d2ceb7680f9053320d22cf1aec0427c8eeab788a192c48d27923e3aL60-R58) [[4]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-5be427473d2ceb7680f9053320d22cf1aec0427c8eeab788a192c48d27923e3aR128-R132) [[5]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-5be427473d2ceb7680f9053320d22cf1aec0427c8eeab788a192c48d27923e3aL156-R163)

* **Imports Cleanup**:
  
  * Removed unused imports and added necessary type imports in various files. (`src/services/pronote/determinate-authentication-view.tsx`) [[1]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-47891cbeff45dcedbf7a64620d2f86a91fae4cacaa8a56e879f2986e4ea59dfeL3-R6) [[2]](https://github.com/PapillonApp/Papillon/pull/239/files#diff-47891cbeff45dcedbf7a64620d2f86a91fae4cacaa8a56e879f2986e4ea59dfeL17-R18)

tgl

@Rexxt
Copy link
Contributor

Rexxt commented Sep 29, 2024

si tu peux juste faire un test de build (ou expliquer pourquoi tu ne l'as pas fait) ça sera parfait

@Louis454545
Copy link
Contributor

tgl

non

@Gabriel29306
Copy link
Contributor Author

Gabriel29306 commented Sep 29, 2024

si tu peux juste faire un test de build (ou expliquer pourquoi tu ne l'as pas fait) ça sera parfait

Je n'en ai pas fait car je ne trouve pas utile d'en faire vu que les modifications ne sont pas profondes.

Note: un compte créé à partir de cette PR peut être réutilisé en revenant sur la branche main !

@Gabriel29306
Copy link
Contributor Author

mais c'est déjà implémenté dans l'app depuis le début si je ne me trompe pas ?

QR Code Method Papillon

On parle ici des codes PIN qui sont là en tant que 2FA

Copy link
Contributor

@LeGeek01 LeGeek01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ça fonctionne du feu de dieu, je peux enfin utiliser l'appli !

Copy link
Member

@Vexcited Vexcited left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L'implémentation Pawnote est correcte.
Rien à signaler de mon côté.

@Gabriel29306
Copy link
Contributor Author

L'implémentation Pawnote est correcte.
Rien à signaler de mon côté.

Ça veut dire que j'ai bien recopié l'exemple de Pawnote 🤓

@LeGeek01
Copy link
Contributor

il faudrait utiliser la fonction link des issues via les pr pour les close automatiquement et faire le lien
image

@Gabriel29306
Copy link
Contributor Author

Avant merge, y a t il aussi le code pin à rentrer en cas de QrCode ?

@LeGeek01
Copy link
Contributor

J'ai pas testé mais il me semble que oui puisque le code est demandé sur l'appli quand la webview s'ouvre

@Gabriel29306
Copy link
Contributor Author

Bon bah j'aurais une petite redirection à rajouter

@Vexcited Vexcited linked an issue Oct 1, 2024 that may be closed by this pull request
@ecnivtwelve ecnivtwelve merged commit d582132 into PapillonApp:main Oct 1, 2024
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 this pull request may close these issues.

[Bug]: Connexion impossible espace élève avec code pin imposé
9 participants