fix(webui): send a refused browser to sign in, and drop an unused method

Two loose ends from the sign-in work, both mine.

A browser that cannot authenticate now goes to the provider when this instance has
a sign-in flow, instead of being shown the shared-token paste page -- a page that
cannot help it, because the token it would paste is not what this instance accepts.
A refusal that signing in again cannot fix, a suspended identity, is still answered
rather than redirected: sending someone back to a provider that already authenticated
them would hide the reason they were refused.

ProviderSession.Expired is removed. Nothing called it, and it must not: expiry is
the verifier's check, and a second opinion about whether a token is still good is
exactly the sort of near-duplicate that drifts from the authority it copies. The
browser path re-runs the flow when verification refuses, which is one rule rather
than two.

Verified: task check exit 0 on this tree.
This commit is contained in:
sam committed 2026-09-22 15:02:27 +10:00
1 parent 79f521b65b
commit debeb869bb
3 files changed
+80 -11

No files matched your search

-7
View File
@@ -85,13 +85,6 @@ type ProviderSession struct {
Expires time.Time
}
// Expired reports whether a session's token is past the point of being worth
// presenting, so a caller can send the browser through the flow again instead of
// letting every request fail verification.
func (s ProviderSession) Expired(now time.Time) bool {
return !s.Expires.IsZero() && !now.Before(s.Expires)
}
var (
// ErrNoCredential means the request presented nothing to authenticate with.
ErrNoCredential = errors.New("no credential presented")