mirror of
https://github.com/davidallendj/opaal.git
synced 2025-12-20 11:37:01 -07:00
Fixed some minor issues
This commit is contained in:
parent
7022801fe9
commit
e929fac09e
4 changed files with 15 additions and 10 deletions
|
|
@ -57,7 +57,7 @@ func (s *Server) StartLogin(clients []oauth.Client, params ServerParams) error {
|
|||
|
||||
// make the login page SSO buttons and authorization URLs to write to stdout
|
||||
buttons := ""
|
||||
fmt.Printf("Login with external identity providers: \n")
|
||||
fmt.Printf("Login with an identity provider: \n")
|
||||
for i, client := range clients {
|
||||
// fetch provider configuration before adding button
|
||||
p, err := oidc.FetchServerConfig(client.Provider.Issuer)
|
||||
|
|
@ -74,8 +74,7 @@ func (s *Server) StartLogin(clients []oauth.Client, params ServerParams) error {
|
|||
|
||||
clients[i].Provider = *p
|
||||
buttons += makeButton(fmt.Sprintf("/login?sso=%s", client.Id), client.Name)
|
||||
url := client.BuildAuthorizationUrl(s.State)
|
||||
fmt.Printf("\t%s\n", url)
|
||||
fmt.Printf("\t%s: /login?sso=%s\n", client.Name, client.Id)
|
||||
}
|
||||
|
||||
var code string
|
||||
|
|
@ -115,7 +114,9 @@ func (s *Server) StartLogin(clients []oauth.Client, params ServerParams) error {
|
|||
client = &clients[index]
|
||||
|
||||
url := client.BuildAuthorizationUrl(s.State)
|
||||
fmt.Printf("Redirect URL: %s\n", url)
|
||||
if params.Verbose {
|
||||
fmt.Printf("Redirect URL: %s\n", url)
|
||||
}
|
||||
http.Redirect(w, r, url, http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue