-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56a8154
commit f144fe9
Showing
18 changed files
with
339 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,15 @@ INSERT INTO users | |
(id, email, email_verified, email_verified_at, encrypted_password, created_at, updated_at, | ||
given_name, family_name, phone_number, job, encrypted_totp_key, totp_key_verified_at, force_2fa) | ||
VALUES | ||
(1, '[email protected]', true, CURRENT_TIMESTAMP, | ||
(1, '[email protected]', true, CURRENT_TIMESTAMP, | ||
'$2a$10$kzY3LINL6..50Fy9shWCcuNlRfYq0ft5lS.KCcJ5PzrhlWfKK4NIO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, | ||
'Jean', 'Jean', '0123456789', 'Sbire', | ||
'Rogal', 'Dorn', 'VII', 'Primarque', | ||
'kuOSXGk68H2B3pYnph0uyXAHrmpbWaWyX/iX49xVaUc=.VMPBZSO+eAng7mjS.cI2kRY9rwhXchcKiiaMZIg==', | ||
CURRENT_TIMESTAMP, true | ||
), | ||
(2, '[email protected]', true, CURRENT_TIMESTAMP, | ||
(2, '[email protected]', true, CURRENT_TIMESTAMP, | ||
'$2a$10$kzY3LINL6..50Fy9shWCcuNlRfYq0ft5lS.KCcJ5PzrhlWfKK4NIO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, | ||
'Jean2', 'Jean2', '0123456789', 'Sbire', | ||
'Konrad', 'Curze', 'VIII', 'Primarque', | ||
'kuOSXGk68H2B3pYnph0uyXAHrmpbWaWyX/iX49xVaUc=.VMPBZSO+eAng7mjS.cI2kRY9rwhXchcKiiaMZIg==', | ||
CURRENT_TIMESTAMP, true | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,58 @@ | ||
describe("delete TOTP connexion", () => { | ||
before(() => { | ||
cy.mailslurp().then((mailslurp) => | ||
mailslurp.inboxController.deleteAllInboxEmails({ | ||
inboxId: "eab4ab97-875d-4ec7-bdcc-04323948ee63", | ||
}), | ||
); | ||
cy.mailslurp().then((mailslurp) => | ||
mailslurp.inboxController.deleteAllInboxEmails({ | ||
inboxId: "c9fabb94-9274-4ece-a3d0-54b1987c8588", | ||
}), | ||
); | ||
}); | ||
|
||
it("should delete TOTP application", function () { | ||
cy.visit("/connection-and-account"); | ||
|
||
cy.mfaLogin("[email protected]"); | ||
cy.mfaLogin("[email protected]"); | ||
|
||
cy.contains("Configurer un code à usage unique"); | ||
|
||
cy.contains("Supprimer l’application d’authentification").click(); | ||
|
||
cy.contains("L’application d’authentification a bien été supprimée."); | ||
|
||
cy.mailslurp() | ||
// use inbox id and a timeout of 30 seconds | ||
.then((mailslurp) => | ||
mailslurp.waitForLatestEmail( | ||
"eab4ab97-875d-4ec7-bdcc-04323948ee63", | ||
60000, | ||
true, | ||
), | ||
) | ||
// check subject of deletion email | ||
.then((email) => { | ||
expect(email.subject).to.include( | ||
"Suppression d'une application d'authentification à double facteur", | ||
); | ||
}); | ||
cy.maildevGetMessageBySubject( | ||
"Suppression d'une application d'authentification à double facteur", | ||
).then((email) => { | ||
cy.maildevVisitMessageById(email.id); | ||
cy.contains( | ||
"L'application a été supprimée comme étape de connexion à deux facteurs.", | ||
); | ||
cy.maildevDeleteMessageById(email.id); | ||
}); | ||
}); | ||
|
||
it("should not be ask to sign with TOTP", function () { | ||
cy.visit("http://localhost:4000"); | ||
cy.get("button.proconnect-button").click(); | ||
cy.login("[email protected]"); | ||
cy.login("[email protected]"); | ||
|
||
cy.contains('"amr": [\n "pwd"\n ],'); | ||
}); | ||
|
||
it("should disable TOTP", function () { | ||
cy.visit("/connection-and-account"); | ||
|
||
cy.mfaLogin("[email protected]"); | ||
cy.mfaLogin("[email protected]"); | ||
|
||
cy.contains("Validation en deux étapes"); | ||
|
||
cy.contains("Désactiver la validation en deux étapes").click(); | ||
|
||
cy.mailslurp() | ||
// use inbox id and a timeout of 30 seconds | ||
.then((mailslurp) => | ||
mailslurp.waitForLatestEmail( | ||
"c9fabb94-9274-4ece-a3d0-54b1987c8588", | ||
60000, | ||
true, | ||
), | ||
) | ||
// check subject of deletion email | ||
.then((email) => { | ||
expect(email.subject).to.include( | ||
"Désactivation de la validation en deux étapes", | ||
); | ||
}); | ||
cy.maildevGetMessageBySubject( | ||
"Désactivation de la validation en deux étapes", | ||
).then((email) => { | ||
cy.maildevVisitMessageById(email.id); | ||
cy.contains( | ||
"Votre compte ProConnect n'est plus protégé par la validation en deux étapes.", | ||
); | ||
cy.maildevDeleteMessageById(email.id); | ||
}); | ||
}); | ||
|
||
it("should not be ask to sign with TOTP", function () { | ||
cy.visit("http://localhost:4000"); | ||
cy.get("button.proconnect-button").click(); | ||
cy.login("[email protected]"); | ||
cy.login("[email protected]"); | ||
|
||
cy.contains('"amr": [\n "pwd"\n ],'); | ||
}); | ||
|
Oops, something went wrong.