Add API Key visual protection (#851)

Add API Key visual protection
This commit is contained in:
vgpastor 2020-10-03 17:13:28 +02:00 committed by GitHub
parent 95a40d3565
commit 5363e4aa0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 1 deletions

View File

@ -6,6 +6,7 @@ return [
'newapikey' => 'New API Key',
'yourprofile' => 'Your Profile',
'apikey' => 'API Key',
'apikey-show' => 'Show key',
'dontshare' => 'don\'t share this!',
'changepassword' => 'Change Password',
'newpassword' => 'New Password',

View File

@ -6,6 +6,7 @@ return [
'newapikey' => 'Nueva clave API',
'yourprofile' => 'Tu perfil',
'apikey' => 'Clave API',
'apikey-show' => 'Mostrar clave',
'dontshare' => '¡No compartas esto!',
'changepassword' => 'Cambiar contraseña',
'newpassword' => 'Nueva contraseña',

View File

@ -5,6 +5,7 @@ return [
'newapikey' => 'Nuova Chiave API',
'yourprofile' => 'Il Tuo Profilo',
'apikey' => 'Chiave API',
'apikey-show' => 'Mostra chiave',
'dontshare' => 'non condividerla!',
'changepassword' => 'Cambia Password',
'newpassword' => 'Nuova Password',

View File

@ -6,6 +6,7 @@ return [
'newapikey' => 'Nova Chave API',
'yourprofile' => 'Seu Perfil',
'apikey' => 'Chave API',
'apikey-show' => 'Mostrar chave',
'dontshare' => 'Não compartilhe isso!',
'changepassword' => 'Mudar Senha',
'newpassword' => 'Nova Senha',

View File

@ -114,7 +114,7 @@
</tr>
<tr>
<td>@lang('profile.apikey')&nbsp;&nbsp;<span class="description">(@lang('profile.dontshare'))</span></td>
<td>{{ $user->api_key }}</td>
<td><span id="apiKey_show" style="display: none">{{ $user->api_key }} <i class="fas fa-eye-slash" onclick="apiKeyHide()"></i></span><span id="apiKey_hide">@lang('profile.apikey-show') <i class="fas fa-eye" onclick="apiKeyShow()"></i></span></td>
</tr>
<tr>
<td>@lang('common.timezone')</td>
@ -145,3 +145,16 @@
</div>
</div>
@endsection
@section('scripts')
<script>
function apiKeyShow(){
document.getElementById("apiKey_show").style = "display:block";
document.getElementById("apiKey_hide").style = "display:none";
}
function apiKeyHide(){
document.getElementById("apiKey_show").style = "display:none";
document.getElementById("apiKey_hide").style = "display:block";
}
</script>
@endsection