Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added the way to activate remember me in the new authentication system#15464

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
parijke wants to merge1 commit intosymfony:5.3fromparijke:patch-1

Conversation

@parijke
Copy link
Contributor

I had to search a while for myself not understanding why I did not have a REMEMBERME cookie when I activated the new system. So maybe handy to add it.

I had to search a while for myself not understanding why I did not have a REMEMBERME cookie when I activated the new system. So maybe handy to add it.
The user will then automatically be logged in on subsequent visits while
the cookie remains valid.

Beware that in the new Authenitaction System you have to set the RememberMeBadge()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Beware that in the newAuthenitaction System you have to set the RememberMeBadge()
Beware that in the newauthenitaction system you have to set the``RememberMeBadge()``

the cookie remains valid.

Beware that in the new Authenitaction System you have to set the RememberMeBadge()
in the authenticate method of the authenticator, like:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
in the authenticate method of the authenticator, like:
in the``authenticate()`` method of the authenticator::

Comment on lines +173 to +189
..code-block::php
public function authenticate(Request $request): PassportInterface
{
$email = $request->request->get('email', '');
$request->getSession()->set(Security::LAST_USERNAME, $email);
return new Passport(
new UserBadge($email),
new PasswordCredentials($request->request->get('password', '')),
[
new CsrfTokenBadge('authenticate', $request->get('_csrf_token')),
new RememberMeBadge(),
]
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
..code-block::php
public function authenticate(Request $request): PassportInterface
{
$email = $request->request->get('email', '');
$request->getSession()->set(Security::LAST_USERNAME, $email);
return new Passport(
new UserBadge($email),
new PasswordCredentials($request->request->get('password', '')),
[
new CsrfTokenBadge('authenticate', $request->get('_csrf_token')),
new RememberMeBadge(),
]
);
}
public function authenticate(Request $request): PassportInterface
{
$email = $request->request->get('email', '');
$request->getSession()->set(Security::LAST_USERNAME, $email);
return new Passport(
new UserBadge($email),
new PasswordCredentials($request->request->get('password', '')),
[
new CsrfTokenBadge('authenticate', $request->get('_csrf_token')),
new RememberMeBadge(),
]
);
}

Copy link
Contributor

@OskarStarkOskarStark left a comment

Choose a reason for hiding this comment

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

Some comments

The user will then automatically be logged in on subsequent visits while
the cookie remains valid.

Beware that in the new Authenitaction System you have to set the RememberMeBadge()

Choose a reason for hiding this comment

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

Little spelling error :)

Suggested change
Beware that in the newAuthenitaction System you have to set the RememberMeBadge()
Beware that in the newauthentication system you have to set the``RememberMeBadge()``

@javiereguiluz
Copy link
Member

@wouterj do you agree with the proposed changes here? I see that in your PR#15503 you didn't update thesecurity/remember_me.rst file, so I'm curious. Thanks!

@wouterj
Copy link
Member

Hi there! There has been some unfortunate delay with documenting the new remember me system.

I've proposed a complete update of the remember docs now:#16376 I've cherry-picked your commit in that PR, as it's just me being late on this PR that avoided this commit to make it into the docs repo in the first place.
Thanks for taking the time to not only figure out what was missing your case, but also proposing a doc change to help others@parijke!

@wouterjwouterj closed thisJan 7, 2022
wouterj added a commit that referenced this pull requestJan 19, 2022
…dojulien, parijke, wouterj)This PR was merged into the 5.3 branch.Discussion----------[Security] Document the new remember me systemFixes#15721,fixes#16149Replaces#15464, replaces#15893Ref#15908In Symfony 5.3, along with the new authentication system, we also somewhat silently introduced a new remember me system. Time to update the remember me docs with all new features :)This PR also includes 2 commits from open PRs in this repository. We've been very late with this one, and community members have already invested time in contributing necessary changes to the docs before. They deserve the credits :)`@javiereguiluz` I'm sorry for not informing you of this work before, I see you just merged a third PR that is replaced by this one.Commits-------5ac2d26 Document the new remember me system2df2275 Added the way to activate remember me in the new authentication systemd36b949 Update remember_me.rst
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark requested changes

+1 more reviewer

@benjaminmalbenjaminmalbenjaminmal left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@parijke@javiereguiluz@wouterj@OskarStark@benjaminmal@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp