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

do not remember session tokens by default #2351

Merged
merged 2 commits into from
Nov 28, 2016

Conversation

ChristophWurst
Copy link
Member

We have to respect the value of the remember-me checkbox. Due to an error
in the source code the default value for the session token was to remember
it.

@mention-bot
Copy link

@ChristophWurst, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rullzer, @icewind1991 and @LukasReschke to be potential reviewers.

@@ -850,7 +890,7 @@ public function testCreateSessionTokenWithTokenPassword() {

$this->tokenProvider->expects($this->once())
->method('generateToken')
->with($sessionId, $uid, $loginName, $realPassword, 'Firefox');
Copy link
Member Author

Choose a reason for hiding this comment

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

Hm. I would have expected this assertion to fail.

We have to respect the value of the remember-me checkbox. Due to an error
in the source code the default value for the session token was to remember
it.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@@ -801,11 +800,52 @@ public function testCreateSessionToken() {

$this->tokenProvider->expects($this->once())
->method('generateToken')
->with($sessionId, $uid, $loginName, $password, 'Firefox');
->with($sessionId, $uid, $loginName, $password, 'Firefox', IToken::DO_NOT_REMEMBER, IToken::TEMPORARY_TOKEN);
Copy link
Member

Choose a reason for hiding this comment

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

The order seems to be mixed up here. 😕

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. Apparently the test did not fail because both constants define the same value 😟

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@codecov-io
Copy link

codecov-io commented Nov 28, 2016

Current coverage is 57.06% (diff: 100%)

Merging #2351 into master will increase coverage by <.01%

@@             master      #2351   diff @@
==========================================
  Files          1191       1191          
  Lines         71912      71920     +8   
  Methods        7299       7299          
  Messages          0          0          
  Branches       1213       1213          
==========================================
+ Hits          41036      41044     +8   
  Misses        30876      30876          
  Partials          0          0          
Diff Coverage File Path
•••••••••• 100% lib/private/User/Session.php

Powered by Codecov. Last update 7e6f829...6543182

@MorrisJobke
Copy link
Member

👍

@LukasReschke
Copy link
Member

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants