diff options
| author | wikiapiserver | 2026-06-25 14:59:59 +0200 |
|---|---|---|
| committer | wikiapiserver | 2026-06-25 14:59:59 +0200 |
| commit | 857fc8bd77e36a45b249b83419c7ba3dde2b792a (patch) | |
| tree | d568befb95470aced90c6a121200871d4b6957b3 /db/db.go | |
| parent | cc960860e4109b4eb50721d0b3338df4b859d559 (diff) | |
| download | wikiapiserver-857fc8bd77e36a45b249b83419c7ba3dde2b792a.tar.gz | |
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.
Diffstat (limited to 'db/db.go')
| -rw-r--r-- | db/db.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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") |
