mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 01:02:42 +01:00
Show a "Logout?" dialog when the user goes to /logout/
Summary: Currently, the logout link is this awkward form in the footer since we have to CSRF it. Enable a GET + dialog + confirm workflow instead so the logout link can just be a link instead of this weird mess. Test Plan: Went to /logout/, logged out. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D3066
This commit is contained in:
parent
321df38ccf
commit
94bc4003f1
1 changed files with 11 additions and 0 deletions
|
@ -58,6 +58,17 @@ final class PhabricatorLogoutController
|
|||
->setURI('/login/');
|
||||
}
|
||||
|
||||
if ($user->getPHID()) {
|
||||
$dialog = id(new AphrontDialogView())
|
||||
->setUser($user)
|
||||
->setTitle('Log out of Phabricator?')
|
||||
->appendChild('<p>Are you sure you want to log out?</p>')
|
||||
->addSubmitButton('Log Out')
|
||||
->addCancelButton('/');
|
||||
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
}
|
||||
|
||||
return id(new AphrontRedirectResponse())->setURI('/');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue