Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix "become user"

  • Loading branch information...
commit bcfff5a7665bb2421467031400070237704d5ae6 1 parent affb649
JT Smith rizen authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/Wing/Web/Admin/User.pm
7 lib/Wing/Web/Admin/User.pm
View
@@ -30,7 +30,7 @@ post '/admin/user' => sub {
get '/admin/user/:id' => sub {
my $current_user = get_admin_by_session_id();
- template 'admin/user', { current_user => describe($current_user, current_user => $current_user), page_title => 'Edit User', user => describe(fetch_object('User'), current_user => $current_user)};
+ template 'admin/user', { current_user => describe($current_user, current_user => $current_user), page_title => 'Edit User', user => describe(fetch_object('User'), current_user => $current_user, include_options => 1)};
};
post '/admin/user/:id' => sub {
@@ -66,9 +66,8 @@ post '/admin/user/:id' => sub {
post '/admin/user/:id/become' => sub {
my $current_user = get_admin_by_session_id();
my $object = fetch_object('User');
- my $session = $current_user->current_session;
- $session->user_id($object->id);
- $session->extend;
+ $current_user->current_session->end;
+ my $session = $object->start_session({ api_key_id => Wing->config->get('default_api_key'), ip_address => request->remote_address });
set_cookie session_id => $session->id,
expires => '+5y',
http_only => 0,
Please sign in to comment.
Something went wrong with that request. Please try again.