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

Feat/accept third party cookies #107

Merged
merged 2 commits into from
Nov 21, 2021

Conversation

TimLehner
Copy link
Contributor

Description

Similar behaviour is available using preLoginSelector, however this only works for accepting cookies on the user's application. This change:

  • allows configuring multiple additional selectors, which will be used after the initial login click, but before attempting to enter third-party credentials
  • allows a user to configure the plugin to click third-party GDPR-related warnings, for example those seen on Facebook

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Related Issue

#27

Motivation and Context

Trying to test a more-complicated login flow, where clicking the login button with existing React state may send additional context on the backend, e.g. for linking existing accounts. As a result I don't think I'm able to navigate directly to /api/auth/signin/facebook, instead I want to go to /api/auth/signin and use a selector to find the 'Facebook' button.

How Has This Been Tested?

Tested as part of integrating in my own project.

For example, took accept only essential cookies on Facebook:

const socialLoginOptions = {
  username,
  password,
  ...,
  loginSelector: 'form[action="http://localhost:3000/api/auth/signin/facebook"] > button[type="submit"]',
  trackingConsentSelectors: [
    'button[data-testid="cookie-policy-dialog-manage-button"]',
    'button[data-testid="cookie-policy-manage-dialog-accept-button"]'
  ]
}
cy.task('FacebookSocialLogin', socialLoginOptions).then(({ cookies, lsd, ssd }) => {
  ...
}

Screenshots (if appropriate):

image

Checklist:

  • I have updated the documentation (if required).
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I added a picture of a cute animal cause it's fun

 - similar behaviour is available using preLoginSelector, however this only works for accepting cookies on the user's application.
  - this allows configuring multiple additional selectors, which will be used after the initial login click, but before attempting to enter third-party credentials
  -this allows a user to configure the plugin to click third-party GDPR-related warnings, for example those seen on Facebook
@lirantal lirantal self-requested a review November 21, 2021 06:12
@lirantal lirantal added the enhancement New feature or request label Nov 21, 2021
@lirantal
Copy link
Owner

That looks good @TimLehner
Thank you 👏

@lirantal lirantal merged commit 35e9ae0 into lirantal:master Nov 21, 2021
@TimLehner
Copy link
Contributor Author

That's great, thanks! Is there anything I need to do to get this into a minor release?

@lirantal
Copy link
Owner

🎉 This PR is included in version 1.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lirantal
Copy link
Owner

:-)

Thank you again @TimLehner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants