Actions for API key management
- (in Account controller)
sub get_api_key :Local {
my ($self, $c) = @_;
$c->detach('/not_found') unless $c->user;
my $key = $c->user->get_api_key;
$c->stash->{key} = $key->apikey;
$c->view->template('account/api_key');
}
sub invalidate_api_keys :Local {
my ($self, $c) = @_;
$c->detach('/not_found') unless $c->user;
$c->user->api_keys->delete; # DBIC::Restricted::ApiKeys->delete also ok
$c->view->template('account/cleared_keys');
}