mirror of
https://github.com/simonw/datasette.git
synced 2026-09-12 03:24:18 +02:00
Reject invalid token expiry input
This commit is contained in:
parent
6aa58bf4e5
commit
1be4df77ac
1 changed files with 5 additions and 0 deletions
|
|
@ -874,6 +874,11 @@ class CreateTokenView(BaseView):
|
|||
else:
|
||||
errors.append("Invalid expire duration unit")
|
||||
|
||||
if errors:
|
||||
context = await self.shared(request)
|
||||
context["errors"] = errors
|
||||
return await self.render(["create_token.html"], request, context)
|
||||
|
||||
# Are there any restrictions?
|
||||
from datasette.tokens import TokenRestrictions
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue