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

CATROID-374 Implement sharing WebView Login automatically #3480

Merged
merged 1 commit into from
Feb 19, 2020

Conversation

mstoeg
Copy link
Contributor

@mstoeg mstoeg commented Feb 16, 2020

No description provided.

Copy link
Contributor

@gPathpp gPathpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test will be added later.

@@ -249,6 +255,29 @@ private String getExtensionFromContentDisposition(String contentDisposition) {
return extension;
}

public void setLoginCookies(String url) {
SharedPreferences sharedPreferences =
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you declare sharedPreferences and cookieManager as a parameter, you'll be able to test the method. (Hint: mock it)

Cookie tokenCookie = new Cookie(Cookie.TOKEN_COOKIE, token);
CookieManager.getInstance().setCookie(url, usernameCookie.generateCookieString());
CookieManager.getInstance().setCookie(url, tokenCookie.generateCookieString());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test.

@wslany wslany merged commit 77ff5fd into Catrobat:develop Feb 19, 2020
@wslany
Copy link
Member

wslany commented Feb 19, 2020

Thanks!

Koell pushed a commit to Koell/Catroid that referenced this pull request Feb 28, 2020
CATROID-374 Implement sharing WebView Login automatically
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants