use of org.stepik.plugin.auth.webkit.network.CookieManager in project intellij-plugins by StepicOrg.
the class AuthDialog method initCookieManager.
@NotNull
private CookieManager initCookieManager(boolean clearCookies) {
CookieHandler cookieManager = CookieManager.getDefault();
if (!(cookieManager instanceof CookieManager)) {
cookieManager = new CookieManager();
}
if (clearCookies) {
((CookieManager) cookieManager).clear();
clearedCookies = true;
}
CookieManager.setDefault(cookieManager);
return (CookieManager) cookieManager;
}
use of org.stepik.plugin.auth.webkit.network.CookieManager in project intellij-plugins by StepicOrg.
the class AuthDialog method showAuthForm.
@NotNull
public static Map<String, String> showAuthForm() {
AuthDialog instance = new AuthDialog();
instance.setVisible(true);
boolean isCanceled = instance.map.isEmpty() || instance.map.containsKey("error");
if (!instance.clearedCookies || !isCanceled) {
instance.saveCookies();
} else {
// Restore cookies from store
CookieManager.setDefault(new CookieManager());
}
return instance.map;
}
Aggregations