<%ARGS>
$Owner
$Error => ''
$Description => ''
</%ARGS>
<%INIT>
# Don't require password for systems with some form of federated auth
my %res = $session{'CurrentUser'}->CurrentUserRequireToSetPassword();
my $require_password = 1;
if ( RT->Config->Get('DisablePasswordForAuthToken') or not $res{'CanSet'} ) {
   $require_password = 0;
}
</%INIT>
<form class="authtoken-form" method="post" data-ajax-url="<% RT->Config->Get('WebPath') %>/Helpers/AuthToken/Create">
% if ($Error) {
<p class="error"><% $Error %></p>
% }
<input type="hidden" name="Owner" value="<% $Owner %>">
<table>
% if ( $require_password ){
<tr>
<td class="label"><&|/l, $session{'CurrentUser'}->Name()&>[_1]'s current password</&>:</td>
<td class="value"><input type="password" name="Password" size="16" autocomplete="off" /></td>
</tr>
% }
<tr>
<td class="label"><&|/l&>Description</&>:<br><em><&|/l&>What's this token for?</&></em></td>
<td class="value"><input type="text" name="Description" value="<% $Description %>" size="16" /></td>
</tr>
</table>
<& /Elements/Submit, Label => loc("Create"), Name => 'CreateToken' &>
<span class="loading"><img src="<%RT->Config->Get('WebPath')%>/static/images/loading.gif" alt="<%loc('Loading')%>" title="<%loc('Loading')%>" /></span>
</form>
