unkey icon indicating copy to clipboard operation
unkey copied to clipboard

No validation for Expiration date in Settings page

Open bipulpoudel opened this issue 1 year ago • 2 comments

Preliminary Checks

  • [X] I have reviewed the documentation: https://unkey.dev/docs

  • [X] I have searched for existing issues: https://github.com/unkeyed/unkey/issues

  • [X] This issue is not a question, general help request, or anything other than a bug report directly related to Unkey. Please ask questions in our Discord community: https://unkey.dev/discord.

Reproduction / Replay Link (Optional)

No response

Description

The Expiration field on the Settings page currently accepts the ISO format date.

If the user adds an invalid date, there is no validation, it just shows a weird error toast with no context:

image

In my opinion, we can do a few things, my suggestions:

  1. Use a date picker instead of a text field for date input.
  2. Not sure, but validation for past date? Can expiration be set to past date?
  3. An expire now button? To expire key at this very time?
  4. If we gonna use text input with iso format, maybe a validation to notify the user?

Environment

No response

bipulpoudel avatar Nov 16 '23 03:11 bipulpoudel

@perkinsjr , @chronark , I can work on this issue, if assigned :).

Just want your confirmation for a list of things, that we can do. Maybe few more suggestions?

bipulpoudel avatar Nov 16 '23 03:11 bipulpoudel

yeah sgtm expiration in the past may make sense to immediately invalidate the key, although we want to make a feature on its own soon. so we don't need an "expire now" button, but a datetime picker would be nice indeed

chronark avatar Nov 16 '23 15:11 chronark