- Added a new blueprint for password recovery (`05-ulti-recovery.yaml`) to facilitate user password reset via email. - Introduced a new API handler for managing Authentik flow sessions, including starting and responding to flows. - Implemented flow session management with in-memory storage for tracking user sessions during the recovery process. - Enhanced error handling for flow session operations and added unit tests for the new functionalities. - Updated README to include the new recovery flow in the Authentik blueprints documentation.
16 lines
366 B
Go
16 lines
366 B
Go
package authentik
|
|
|
|
import "strings"
|
|
|
|
// APIBaseURL normalizes the Authentik API root (includes /auth when deployed under a subpath).
|
|
func APIBaseURL(raw string) string {
|
|
raw = strings.TrimRight(strings.TrimSpace(raw), "/")
|
|
if raw == "" {
|
|
return "http://authentik-server:9000/auth"
|
|
}
|
|
if strings.HasSuffix(raw, "/auth") {
|
|
return raw
|
|
}
|
|
return raw + "/auth"
|
|
}
|