32 lines
736 B
Go
32 lines
736 B
Go
package auth
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"astraltech.xyz/calendar/v2/webserver"
|
|
)
|
|
|
|
func HandlePasswordAuth(authData webserver.PasswordAuthData) bool {
|
|
fmt.Printf("%s, %s\n", authData.Username, authData.Password)
|
|
return false
|
|
}
|
|
|
|
func HandleOAuth(authData webserver.OAuthAuthData) bool {
|
|
fmt.Printf("doing an OAuth")
|
|
return false
|
|
}
|
|
|
|
func HandleAuthRequest(authType webserver.AuthStyle, authData webserver.AuthData) bool {
|
|
if authType == webserver.AuthStylePassword {
|
|
passwordAuthData, _ := authData.(webserver.PasswordAuthData)
|
|
return HandlePasswordAuth(passwordAuthData)
|
|
}
|
|
|
|
if authType == webserver.AuthStyleOAuth {
|
|
passwordAuthData, _ := authData.(webserver.OAuthAuthData)
|
|
return HandleOAuth(passwordAuthData)
|
|
}
|
|
|
|
return false
|
|
}
|