feat(http): add IssuerBase method for account site redirect
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"slices"
|
"slices"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -21,6 +22,17 @@ var (
|
|||||||
authCookie string = "outfit-voting-abi26-auth"
|
authCookie string = "outfit-voting-abi26-auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func IssuerBaseURL() string {
|
||||||
|
urlstring := provider.Endpoint().AuthURL
|
||||||
|
|
||||||
|
url, err := url.Parse(urlstring)
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
url.Path = "/"
|
||||||
|
return url.String()
|
||||||
|
}
|
||||||
|
|
||||||
func InitProvider(issuer, id, secret, redirect string) error {
|
func InitProvider(issuer, id, secret, redirect string) error {
|
||||||
ctx = context.Background()
|
ctx = context.Background()
|
||||||
var err error
|
var err error
|
||||||
|
|||||||
Reference in New Issue
Block a user