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
|
@ -58,6 +58,17 @@ final class PhabricatorLogoutController
|
||||||
->setURI('/login/');
|
->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('/');
|
return id(new AphrontRedirectResponse())->setURI('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue