fix token expiration date display
This commit is contained in:
parent
64770ea1da
commit
b17854c5c3
2 changed files with 6 additions and 1 deletions
|
@ -6,6 +6,7 @@ from authlib.integrations.sqla_oauth2 import (
|
|||
from authlib.oauth2.rfc6749.util import scope_to_list, list_to_scope
|
||||
from sso.extensions import db
|
||||
from sso.directory import LDAPUserProxy
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class Client(db.Model, OAuth2ClientMixin):
|
||||
|
@ -53,3 +54,7 @@ class Token(db.Model, OAuth2TokenMixin):
|
|||
primaryjoin="Token.client_id == Client.client_id",
|
||||
foreign_keys=[client_id],
|
||||
)
|
||||
|
||||
@property
|
||||
def expires_at_dt(self):
|
||||
return datetime.fromtimestamp(self.get_expires_at())
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<td>
|
||||
{% for scope in token.get_scope().split() %}<code>{{ scope }}</code> {% endfor %}
|
||||
</td>
|
||||
<td>{{ token.get_expires_at() }}</td>
|
||||
<td>{{ token.expires_at_dt }}</td>
|
||||
<td>
|
||||
<form class="text-right" method="post" action="{{ url_for('.token_revoke', id=token.id) }}">
|
||||
{{ csrf_field() }}
|
||||
|
|
Loading…
Add table
Reference in a new issue