fix: issues
This commit is contained in:
@@ -11,6 +11,9 @@ import (
|
||||
)
|
||||
|
||||
func (f *Middlewares) WeChatSilentAuth(c fiber.Ctx) error {
|
||||
log.WithField("module", "middleware.WeChatSilentAuth").Debug("Begin")
|
||||
defer log.WithField("module", "middleware.WeChatSilentAuth").Debug("END")
|
||||
|
||||
// if cookie not exists key "openid", then redirect to the wechat auth page
|
||||
token := c.GetReqHeaders()["Authorization"]
|
||||
if len(token) != 0 {
|
||||
@@ -24,7 +27,7 @@ func (f *Middlewares) WeChatSilentAuth(c fiber.Ctx) error {
|
||||
url = strings.ReplaceAll(url, c.BaseURL(), *f.app.BaseURI)
|
||||
}
|
||||
|
||||
log.WithField("module", "middleware.SilentAuth").Debug("url:", url)
|
||||
log.WithField("module", "middleware.SilentAuth").Debug("redirect_uri: ", url)
|
||||
|
||||
to, err := f.client.ScopeAuthorizeURL(
|
||||
wechat.ScopeAuthorizeURLWithRedirectURI(url),
|
||||
|
||||
Reference in New Issue
Block a user