Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RewriteRedirectPort ¶
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"
State string // expected state parameter; empty when the request had none
}
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.
Click to show internal directories.
Click to hide internal directories.