https://github.com/hugojosefson/capture-auth-url
Capture localhost callback URL from a browser login flow
https://github.com/hugojosefson/capture-auth-url
authentication callback cli deno url
Last synced: 2 months ago
JSON representation
Capture localhost callback URL from a browser login flow
- Host: GitHub
- URL: https://github.com/hugojosefson/capture-auth-url
- Owner: hugojosefson
- Created: 2025-06-26T18:52:36.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-26T19:10:19.000Z (about 1 year ago)
- Last Synced: 2026-02-02T16:05:32.174Z (5 months ago)
- Topics: authentication, callback, cli, deno, url
- Language: TypeScript
- Homepage: https://jsr.io/@hugojosefson/capture-auth-url
- Size: 21.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# capture-auth-url
A Deno module to open a login URL in the user's browser, wait for the user to
authenticate, capture the resulting URL (including the hash), and return it to
the program.
[](https://jsr.io/@hugojosefson/capture-auth-url)
[](https://jsr.io/@hugojosefson/capture-auth-url)
## Usage
```typescript
import { captureAuthUrl } from "jsr:@hugojosefson/capture-auth-url";
const loginUrl =
"https://example.com/login?redirect_uri=http://localhost:1234/callback";
const url = await captureAuthUrl(loginUrl);
console.log(url.toString());
```
## CLI Usage
The CLI allows you to run the module directly from the command line, opening the
login URL in your default browser, and capturing the resulting URL after
authentication.
It prints the resulting URL to standard output.
```
deno run --allow-net --allow-run --allow-env --allow-read jsr:@hugojosefson/capture-auth-url/cli [port]
```
Example:
```
deno run --allow-net --allow-run --allow-env --allow-read jsr:@hugojosefson/capture-auth-url/cli "https://example.com/login?redirect_uri=http://localhost:1234/callback"
```
## License
MIT