-
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.
feat: login_hint from sp does not trigger login prompt
- Loading branch information
Showing
7 changed files
with
60 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ INSERT INTO users | |
(id, email, email_verified, email_verified_at, encrypted_password, created_at, updated_at, given_name, family_name, | ||
phone_number, job) | ||
VALUES | ||
(1, '[email protected]', true, CURRENT_TIMESTAMP, '$2a$10$kzY3LINL6..50Fy9shWCcuNlRfYq0ft5lS.KCcJ5PzrhlWfKK4NIO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Jean', 'Jean', '0123456789', 'Sbire'); | ||
(1, '[email protected]', true, CURRENT_TIMESTAMP, '$2a$10$kzY3LINL6..50Fy9shWCcuNlRfYq0ft5lS.KCcJ5PzrhlWfKK4NIO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Jean', 'Jean', '0123456789', 'Sbire'), | ||
(2, '[email protected]', true, CURRENT_TIMESTAMP, '$2a$10$kzY3LINL6..50Fy9shWCcuNlRfYq0ft5lS.KCcJ5PzrhlWfKK4NIO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Jean', 'Jean', '0123456789', 'Sbire'); | ||
|
||
|
||
INSERT INTO organizations | ||
|
@@ -13,7 +14,8 @@ VALUES | |
INSERT INTO users_organizations | ||
(user_id, organization_id, is_external, verification_type, has_been_greeted) | ||
VALUES | ||
(1, 1, false, 'domain', true); | ||
(1, 1, false, 'domain', true), | ||
(2, 1, false, 'domain', true); | ||
|
||
INSERT INTO oidc_clients | ||
(client_name, client_id, client_secret, redirect_uris, | ||
|
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,7 +1,7 @@ | ||
// | ||
|
||
describe("sign-in from agentconnect client", () => { | ||
it("should sign-in", function () { | ||
it("should sign-in", () => { | ||
cy.visit("http://localhost:4001"); | ||
cy.get("button.moncomptepro-button").click(); | ||
|
||
|
@@ -14,4 +14,31 @@ describe("sign-in from agentconnect client", () => { | |
cy.contains("[email protected]"); | ||
cy.contains("21340126800130"); | ||
}); | ||
|
||
it("should not prompt for password if a session is already opened", () => { | ||
cy.visit("/"); | ||
cy.login("[email protected]"); | ||
|
||
cy.visit("http://localhost:4001"); | ||
cy.get("button.moncomptepro-button").click(); | ||
|
||
cy.contains("moncomptepro-agentconnect-client"); | ||
cy.contains("[email protected]"); | ||
}) | ||
|
||
it("login_hint should take precedence over existing session", () => { | ||
cy.visit("/"); | ||
cy.login("[email protected]"); | ||
|
||
cy.visit("http://localhost:4001"); | ||
cy.get("button.moncomptepro-button").click(); | ||
|
||
cy.get('[name="password"]').type("password123"); | ||
cy.get('[action="/users/sign-in"] [type="submit"]') | ||
.contains("S’identifier") | ||
.click(); | ||
|
||
cy.contains("moncomptepro-agentconnect-client"); | ||
cy.contains("[email protected]"); | ||
}) | ||
}); |
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 |
---|---|---|
|
@@ -56,5 +56,14 @@ describe("sign-in from standard client", () => { | |
cy.contains("Commune de lamalou-les-bains - Mairie"); | ||
}); | ||
|
||
it("should prompt for organization selection", function () {}); | ||
it("should not prompt for password if a session is already opened", () => { | ||
cy.visit("/"); | ||
cy.login("[email protected]"); | ||
|
||
cy.visit("http://localhost:4000"); | ||
cy.get("button.moncomptepro-button").click(); | ||
|
||
cy.contains("moncomptepro-standard-client"); | ||
cy.contains("[email protected]"); | ||
}) | ||
}); |
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
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