oauth

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RewriteRedirectPort

func RewriteRedirectPort(rawURL string, newPort int) string

RewriteRedirectPort returns a copy of rawURL with the redirect_uri's port replaced by newPort. If the URL cannot be parsed or has no redirect_uri, the original URL is returned unchanged.

Types

type RedirectInfo

type RedirectInfo struct {
	Port int    // e.g. 38599
	Path string // e.g. "/callback"
}

RedirectInfo contains the parsed localhost redirect target from an OAuth URL.

func DetectRedirect

func DetectRedirect(rawURL string) *RedirectInfo

DetectRedirect parses rawURL looking for a redirect_uri query parameter that targets localhost. Returns nil if no such redirect is found.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL