mirror of
https://github.com/davidallendj/opaal.git
synced 2025-12-20 03:27:02 -07:00
WIP refactoring login
This commit is contained in:
parent
2e117bea36
commit
61a35c165d
2 changed files with 16 additions and 0 deletions
15
cmd/login.go
15
cmd/login.go
|
|
@ -85,6 +85,11 @@ var loginCmd = &cobra.Command{
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
// use clients to make SSO buttons that
|
||||
for _, client := range config.Authentication.Clients {
|
||||
MakeButton()
|
||||
}
|
||||
|
||||
// start the listener
|
||||
err := opaal.Login(&config, &client, provider)
|
||||
if err != nil {
|
||||
|
|
@ -115,3 +120,13 @@ func init() {
|
|||
loginCmd.MarkFlagsMutuallyExclusive("target.name", "target.index")
|
||||
rootCmd.AddCommand(loginCmd)
|
||||
}
|
||||
|
||||
func MakeButton(url string, text string) string {
|
||||
// check if we have http:// a
|
||||
html := "<input type=\"button\" "
|
||||
html += "class=\"button\" "
|
||||
html += fmt.Sprintf("onclick=\"window.location.href='%s';\" ", url)
|
||||
html += fmt.Sprintf("value=\"%s\"", text)
|
||||
return html
|
||||
// return "<a href=\"" + url + "\"> " + text + "</a>"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue