Tokens: User improvements
This commit is contained in:
parent
8ccd490bed
commit
4f4fa2b3d7
6 changed files with 117 additions and 24 deletions
|
|
@ -0,0 +1,30 @@
|
|||
<div class="pure-u-1">
|
||||
<p>
|
||||
A new token has been created.
|
||||
This token will only be shown once.
|
||||
Please make sure to copy it now.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="pure-u-1">
|
||||
<p>
|
||||
<span class="copy">{{ .Token.Token }}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="pure-u-1">
|
||||
<p>
|
||||
To test this token, you can use curl on the command line:
|
||||
</p>
|
||||
<code class="copy">
|
||||
curl -H "Authorization: Bearer <b>{{ .Token.Token }}</b>" {{ .Domain }}api/v1/auth
|
||||
</code>
|
||||
<p>
|
||||
You should receive a response with <code>token: true</code> inside of it.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="pure-u-1">
|
||||
<a href="/user/tokens/" class="pure-button">Back To Token List</a>
|
||||
</div>
|
||||
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
</p>
|
||||
</div>
|
||||
|
||||
<div class="pure-u-1">
|
||||
<div class="pure-u-2-3">
|
||||
<h2>My Tokens</h2>
|
||||
<p>
|
||||
This table shows tokens currently associated with your account.
|
||||
|
|
@ -16,6 +16,9 @@
|
|||
<table class="pure-table pure-table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
ID
|
||||
</th>
|
||||
<th>
|
||||
Token
|
||||
</th>
|
||||
|
|
@ -32,7 +35,10 @@
|
|||
{{ range .Tokens }}
|
||||
<tr>
|
||||
<td>
|
||||
<code class="copy">{{ .Token }}</code>
|
||||
<code class="copy">{{ .TokenID }}</code>
|
||||
</td>
|
||||
<td>
|
||||
(only shown once)
|
||||
</td>
|
||||
<td>
|
||||
{{ .Description }}
|
||||
|
|
@ -40,7 +46,7 @@
|
|||
<td>
|
||||
<div class="pure-button-group" role="group">
|
||||
<form action="/user/tokens/delete" method="POST" class="pure-form-group">
|
||||
<input type="hidden" name="token" value="{{ .Token }}">
|
||||
<input type="hidden" name="id" value="{{ .TokenID }}">
|
||||
<input type="submit" class="pure-button pure-button-danger" value="Delete">
|
||||
{{ $csrf }}
|
||||
</form>
|
||||
|
|
@ -54,3 +60,14 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pure-u-1-3">
|
||||
<p>
|
||||
To check if a token is working, you can use something like:
|
||||
</p>
|
||||
<code class="copy">
|
||||
curl -H "Authorization: Bearer <b><token></b>" {{ .Domain }}api/v1/auth
|
||||
</code>
|
||||
<p>
|
||||
When using a working token, you should get a response with <code>Token: true</code> in it.
|
||||
</p>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue