Skip to content

Commit f223c06

Browse files
committed
chore: update yahoo example
1 parent d9d12af commit f223c06

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/all.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ func main() {
1212
g := goic.New("/auth/o8", true)
1313
g.AddProvider(goic.Google.WithCredential(os.Getenv("GOOGLE_CLIENT_ID"), os.Getenv("GOOGLE_CLIENT_SECRET")))
1414
g.AddProvider(goic.Microsoft.WithCredential(os.Getenv("MICROSOFT_CLIENT_ID"), os.Getenv("MICROSOFT_CLIENT_SECRET")))
15+
g.AddProvider(goic.Yahoo.WithCredential(os.Getenv("YAHOO_CLIENT_ID"), os.Getenv("YAHOO_CLIENT_SECRET")))
1516

1617
g.UserCallback(func(t *goic.Token, u *goic.User, w http.ResponseWriter, r *http.Request) {
17-
log.Println("token: ", t)
18-
log.Println("user: ", u)
18+
log.Println("token: ", t, "\nuser: ", u)
1919
_, _ = w.Write([]byte("All good, check backend console"))
2020
})
2121

@@ -24,9 +24,10 @@ func main() {
2424
_, _ = w.Write([]byte(r.Method + " " + r.URL.Path))
2525
}
2626

27-
log.Println("Server running on https://localhost")
28-
log.Println(" Visit https://localhost/auth/o8/google")
29-
log.Println(" OR https://localhost/auth/o8/microsoft")
27+
log.Println("Server running on https://localhost, You can visit any of the below URLs:")
28+
for _, v := range []string{"google", "microsoft", "yahoo"} {
29+
log.Printf(" https://localhost/auth/o8/%s\n", v)
30+
}
3031
http.HandleFunc("/", g.MiddlewareFunc(handler))
3132
log.Fatal(http.ListenAndServeTLS(addr, "server.crt", "server.key", nil))
3233
}

0 commit comments

Comments
 (0)