Skip to content

do not remember session tokens by default - #2351

Merged
LukasReschke merged 2 commits into
masterfrom
remember-session-default
Nov 28, 2016
Merged

do not remember session tokens by default#2351
LukasReschke merged 2 commits into
masterfrom
remember-session-default

Conversation

@ChristophWurst

Copy link
Copy Markdown
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
Copy Markdown

@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.


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

Copy link
Copy Markdown
MemberAuthor

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>
Comment threadtests/lib/User/SessionTest.php Outdated
$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
Copy Markdown
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
Copy Markdown
MemberAuthor

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

codecov-io commented Nov 28, 2016

Copy link
Copy Markdown

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 CoverageFile Path
•••••••••• 100%lib/private/User/Session.php

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

@MorrisJobke

Copy link
Copy Markdown
Member

👍

@LukasReschke

Copy link
Copy Markdown
Member

LGTM

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@ChristophWurst@mention-bot@codecov-io@MorrisJobke@LukasReschke@justin-sleep