Added swagger for API docs.

This commit is contained in:
cameronts
2022-09-06 05:20:24 -07:00
parent 459e7956cd
commit cb23b871dd
11 changed files with 914 additions and 46 deletions

View File

@@ -82,6 +82,7 @@ func InitializeAuthProvider() string {
return authInfo[0]
}
// Not included in API reference as part of the OAuth process itself.
// HandleAuthCallback - handles oauth callback
func HandleAuthCallback(w http.ResponseWriter, r *http.Request) {
if auth_provider == nil {
@@ -96,7 +97,14 @@ func HandleAuthCallback(w http.ResponseWriter, r *http.Request) {
functions[handle_callback].(func(http.ResponseWriter, *http.Request))(w, r)
}
// HandleAuthLogin - handles oauth login
// swagger:route GET /api/oauth/login nodes HandleAuthLogin
//
// Handles OAuth login
//
// Schemes: https
//
// Security:
// oauth
func HandleAuthLogin(w http.ResponseWriter, r *http.Request) {
if auth_provider == nil {
var referer = r.Header.Get("referer")