From 857fc8bd77e36a45b249b83419c7ba3dde2b792a Mon Sep 17 00:00:00 2001 From: wikiapiserver Date: Thu, 25 Jun 2026 14:59:59 +0200 Subject: feat: GET /token?username=... returns access_token and valid_until Returns the stored access_token and the timestamp when it was created (access_token_created). Returns 401 for unknown users. --- db/db.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'db') diff --git a/db/db.go b/db/db.go index 6fed1b0..228a655 100644 --- a/db/db.go +++ b/db/db.go @@ -315,6 +315,11 @@ func (d *DB) getAccountByUsername(ctx context.Context, username string) (*Accoun return &acct, nil } +// GetAccount fetches the current tokens for a username. +func (d *DB) GetAccount(ctx context.Context, username string) (*Account, error) { + return d.getAccountByUsername(ctx, username) +} + // HealthCheck runs a trivial query to verify DB liveness. func (d *DB) HealthCheck(ctx context.Context) error { _, err := d.conn.ExecContext(ctx, "SELECT 1") -- cgit v1.2.3