fix: GOG sign-in starts without the previous account's web session (#1235)

This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-10-21 00:44:40 -04:00
1 parent 705da08a0e
commit 152b961940
6 files changed
+78 -18

No files matched your search

@@ -0,0 +1,18 @@
package com.droiddeck.launcher.stores
import com.droiddeck.launcher.stores.gog.GogAuth
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
class WebCookiesTest {
@Test fun gogLoginCookiesAreExpiredOnTheLoginHostAndTheDomain() {
val lines = WebCookies.expired("galaxy-login-s=a; galaxy-login-tsa=b; galaxy-login-al=c", GogAuth.COOKIE_DOMAIN, listOf("/"), "login.gog.com")
assertEquals(9, lines.size)
assertTrue(lines.contains("galaxy-login-al=; Max-Age=0; Path=/; Secure"))
assertTrue(lines.contains("galaxy-login-al=; Max-Age=0; Path=/; Secure; Domain=.gog.com"))
assertTrue(lines.contains("galaxy-login-al=; Max-Age=0; Path=/; Secure; Domain=login.gog.com"))
assertTrue(lines.none { it.startsWith("galaxy-login-al=c") })
assertEquals(emptyList<String>(), WebCookies.expired(null, GogAuth.COOKIE_DOMAIN, listOf("/"), "login.gog.com"))
}
}