Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Bypass cookie mismatch error on google login
Browse files Browse the repository at this point in the history
Auditors: @bbondy, @bsclifton

Test Plan:
1. Clean cookies on Chrome/Firefox and login in google account
2. Import cookies from Chrome/Firefox to Brave
3. Login google account on Brave
4. Import cookies from Chrome/Firefox to Brave and refresh
5. Logout google account on Brave
6. There shouldn't be any cookie mismatch error pages displayed within these steps
  • Loading branch information
darkdh committed Oct 10, 2017
1 parent d03bdd2 commit f69bdb9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,17 @@ importer.on('add-cookies', (e, cookies) => {
httpOnly: cookies[i].httponly,
expirationDate: cookies[i].expiry_date
}
// Bypassing cookie mistach error in
// https://github.com/brave/browser-laptop/issues/11401
if (cookie.domain === '.google.com' &&
(cookie.url === 'https://notifications.google.com' ||
cookie.url === 'https://accounts.google.com')) {
continue
}
session.defaultSession.cookies.set(cookie, (error) => {
if (error) {
console.error(error)
console.error(cookie)
}
})
}
Expand Down

0 comments on commit f69bdb9

Please sign in to comment.