Add slug login browser flow #57
Labels
No labels
activitypub
admin
api
articles
auth
bug
cleanup
cli
comments
compatibility
config
contacts
database
deployment
design
dev-env
docs
documentation
email
enhancement
feature
federation
feed
homepage
implementation
integration
media
openapi
priority:high
priority:low
priority:medium
proof
public-routes
public-ui
release
safety
social
sources
status:active
status:canceled
status:done
status:inprogress
status:waiting
syndication
tailwind
template
test
web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
erik/slugkit#57
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Let
slug loginopen the site's browser-based authentication flow, receive or prompt for a newly generated API key, verify it, and store it in the local Slugkit CLI config.Reference behavior:
/home/erik/Private/code/github/evcraddock/erikcraddock.meuses an/cli/authbrowser page that requires an authenticated session and then generates an API key for the CLI.Requirements
slug loginCLI command./cli/auththat requires an authenticated admin session.Acceptance criteria
slug loginopens or prints the browser auth URL./cli/authrequires an authenticated admin session before generating an API key./cli/authredirects through login and returns after successful magic-link verification./cli/authcreates an API key and displays the raw key once.Dependencies
Synced from todu comment by @todu on 2026-05-22T19:17:02.140Z
PR Review: Approved
PR: #60
Summary
Reviewed PR #60 at commit
846b4ae. The PR adds the browser-assisted CLI login flow:/cli/authredirects anonymous users through admin login and generates a raw API key for authenticated sessions,/api/v1/auth/checkverifies bearer API keys, andslug login [api-base-url]opens/prints the browser auth URL, prompts for the pasted key, verifies it, and saves local config without printing the key.Acceptance Criteria
slug loginopens or prints the browser auth URL./cli/authrequires an authenticated admin session before generating an API key./cli/authredirects through login and returns after successful magic-link verification./cli/authcreates an API key and displays the raw key once.make check,./scripts/pre-pr.sh, and Forgejo CI passed.Blocking Issues
None.
Warnings
None.
Verdict
Approved for merge.
Synced from todu comment by @todu on 2026-05-22T19:31:21.627Z
PR Review Update: Approved
PR: #60
Commit:
26da9bbUpdate verified
slug loginnow works without a manually supplied URL when a local dev server is reachable athttp://localhost:3000/api/v1./cli/auth, so the source is visible.Checks
make checkpassed locally../scripts/pre-pr.shpassed locally.26da9bb.Verdict
Approved for merge.
Synced from todu comment by @todu on 2026-05-22T20:07:48.698Z
PR Review Update: Approved
PR: #60
Commit:
ac9e167Update verified
${XDG_CONFIG_HOME:-~/.config}/slug/config.yaml.apiBaseUrl,apiKey, and optionalapiKeyReference; no profiles.--config <file>support, e.g.slug --config ./dev.slug.yaml login.slug loginuses the configuredapiBaseUrl; no URL argument is required for normal use.slug config showcontinues to redact the raw API key.--configfile usage.Checks
make checkpassed locally../scripts/pre-pr.shpassed locally.ac9e167.Verdict
Approved for merge.
Synced from todu comment by @todu on 2026-05-22T20:16:20.969Z
PR Review Update: Approved
PR: #60
Commit:
763b3baUpdate verified
make dev-configto write ignored local CLI config at./.slug/dev.yaml.make slug ARGS="..."to build and run theslugCLI with that dev config..slug/is ignored so generated dev config is not committed.make dev-configwrites the machine IP API URL, e.g.apiBaseUrl: http://<machine-ip>:3000/api/v1.Checks
make dev-configpassed locally.make checkpassed locally../scripts/pre-pr.shpassed locally.763b3ba.Verdict
Approved for merge.
Synced from todu comment by @todu on 2026-05-22T20:24:16.419Z
=== Task Close Gate: Task #task-b8374859 ===
Task: Add slug login browser flow
Acceptance Criteria:
slug loginopens or prints the browser auth URL — met — Implemented CLI login flow; PR #60 includes browser open/printed fallback URL and opener failure handling./cli/authrequires an authenticated admin session before generating an API key — met — Added protected/cli/authroute using admin session middleware./cli/authredirects through login and returns after successful magic-link verification — met — Login redirect preservation added and covered by route tests./cli/authcreates an API key and displays the raw key once — met — Route creates API key via API key service and renders one-time raw key page./api/v1/auth/check; CLI verifies pasted key before writing config.make check,./scripts/pre-pr.sh, and Forgejo CI passed.Readiness: READY
Closing Summary:
Merged PR #60 into main at merge commit
06d5d4d. Addedslug loginbrowser auth flow,/cli/auth,/api/v1/auth/check, YAML CLI config with--config, and Makefile dev helpers (make dev-config,make slug ARGS="...").Next Action: close-task