fix(ui): document token validity in key verification view (#9002)

Document that the token is only valid for a minute. Add a link to get a new token.

Resolves #8048

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9002
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: dawe <dawedawe@posteo.de>
Co-committed-by: dawe <dawedawe@posteo.de>
This commit is contained in:
dawe 2025-11-14 23:40:03 +01:00 committed by Gusted
parent bcd03d0e0d
commit efd4d2d8f5
5 changed files with 61 additions and 0 deletions

View file

@ -52,3 +52,9 @@ func MockProtect[T any](p *T) (reset func()) {
func SleepTillNextSecond() {
time.Sleep(time.Second - time.Since(time.Now().Truncate(time.Second)))
}
// When this is called, sleep until the truncated unix time to a minute was
// increased by one.
func SleepTillNextMinute() {
time.Sleep(time.Minute - time.Since(time.Now().Truncate(time.Minute)))
}