瀏覽代碼

Updated some comments

Toby Chui 6 月之前
父節點
當前提交
1dfb43c999
共有 2 個文件被更改,包括 18 次插入3 次删除
  1. 6 1
      mod/auth/sso/server.go
  2. 12 2
      mod/auth/sso/sso.go

+ 6 - 1
mod/auth/sso/server.go

@@ -12,7 +12,12 @@ import (
 /*
 	server.go
 
-	This is the router for the SSO authentication interface
+	This is the web server for the SSO portal. It contains the
+	HTTP server and the handlers for the SSO portal.
+
+	If you are looking for handlers that changes the settings
+	of the SSO portale or user management, please refer to
+	handlers.go.
 
 */
 

+ 12 - 2
mod/auth/sso/sso.go

@@ -9,6 +9,16 @@ import (
 	"imuslab.com/zoraxy/mod/info/logger"
 )
 
+/*
+	sso.go
+
+	This file contains the main SSO handler and the SSO configuration
+	structure. It also contains the main SSO handler functions.
+
+	SSO web interface are stored in the static folder, which is embedded
+	into the binary.
+*/
+
 //go:embed static/*
 var staticFiles embed.FS //Static files for the SSO portal
 
@@ -54,10 +64,10 @@ func NewSSOHandler(config *SSOConfig) (*SSOHandler, error) {
 	return &thisHandler, nil
 }
 
-// ServeHTTP handle the SSO request by forwarding auth to the authelia server
+// ServeForwardAuth handle the SSO request by forwarding auth to the authelia server
 // return false if the request is not authorized and shall not be proceed
 // Note that only accounts that have SSO enabled will be handled by this handler
-func (h *SSOHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) bool {
+func (h *SSOHandler) ServeForwardAuth(w http.ResponseWriter, r *http.Request) bool {
 	//Check if the user have the cookie "Zoraxy-SSO" set
 	session, err := h.cookieStore.Get(r, "Zoraxy-SSO")
 	if err != nil {