Skip to content

Commit

Permalink
Moved get_key into API route
Browse files Browse the repository at this point in the history
  • Loading branch information
droberts-ctrlo committed Dec 27, 2024
1 parent 73fd8a5 commit a13063b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 0 additions & 11 deletions lib/GADS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4489,17 +4489,6 @@ prefix '/:layout_name' => sub {

};

get '/get_key' => require_login sub {
my $user = logged_in_user;

my $key = $user->encryption_key;

return to_json {
error => 0,
key => $key
}
};

sub reset_text {
my ($dsl, %options) = @_;
my $site = var 'site';
Expand Down
11 changes: 11 additions & 0 deletions lib/GADS/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,17 @@ any ['get', 'post'] => '/api/users' => require_any_role [qw/useradmin superadmin
return encode_json $return;
};

get '/api/get_key' => require_login sub {
my $user = logged_in_user;

my $key = $user->encryption_key;

return to_json {
error => 0,
key => $key
}
};

sub _success
{ my $msg = shift;
send_as JSON => {
Expand Down

0 comments on commit a13063b

Please sign in to comment.