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

[L5] Authentication doesn't persist between requests #2795

Closed
Anahkiasen opened this issue Feb 13, 2016 · 1 comment
Closed

[L5] Authentication doesn't persist between requests #2795

Anahkiasen opened this issue Feb 13, 2016 · 1 comment

Comments

@Anahkiasen
Copy link

@Anahkiasen Anahkiasen commented Feb 13, 2016

Using $I->amLoggedAs(User::find(1)) will execute the following code:

if ($user instanceof Authenticatable) {
    $guard->setUser($user);
    return;
}

However this just calls AuthManager::setUser which just sets the authenticated user for the current request. Instead I believe AuthManager::login should be called, which remembers the user in session, for future requests as well.

Without this if in your functional tests you submit a form or click on a link, you'll be back to the login form. Or was this intended behavior and if so how do I work around this?

@janhenkgerritsen
Copy link
Contributor

@janhenkgerritsen janhenkgerritsen commented Feb 13, 2016

This was not intended behavior, thanks for reporting the issue!

Loading

janhenkgerritsen added a commit that referenced this issue Feb 13, 2016
Fix issue with Laravel 5 module amLoggedAs method, see #2795
Naktibalda added a commit to Naktibalda/Codeception that referenced this issue Feb 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants