88
99 "golang.org/x/crypto/bcrypt"
1010 "gopkg.in/authboss.v0"
11- "gopkg.in/authboss.v0/internal/render "
11+ "gopkg.in/authboss.v0/internal/response "
1212)
1313
1414const (
@@ -24,7 +24,7 @@ func init() {
2424
2525// Auth module
2626type Auth struct {
27- templates render .Templates
27+ templates response .Templates
2828}
2929
3030// Initialize module
@@ -41,7 +41,7 @@ func (a *Auth) Initialize() (err error) {
4141 return errors .New ("auth: XSRFMaker must be defined" )
4242 }
4343
44- a .templates , err = render .LoadTemplates (authboss .Cfg .Layout , authboss .Cfg .ViewsPath , tplLogin )
44+ a .templates , err = response .LoadTemplates (authboss .Cfg .Layout , authboss .Cfg .ViewsPath , tplLogin )
4545 if err != nil {
4646 return err
4747 }
@@ -71,7 +71,7 @@ func (a *Auth) loginHandlerFunc(ctx *authboss.Context, w http.ResponseWriter, r
7171 if _ , ok := ctx .SessionStorer .Get (authboss .SessionKey ); ok {
7272 if halfAuthed , ok := ctx .SessionStorer .Get (authboss .SessionHalfAuthKey ); ! ok || halfAuthed == "false" {
7373 //http.Redirect(w, r, authboss.Cfg.AuthLoginOKPath, http.StatusFound, true)
74- render .Redirect (ctx , w , r , authboss .Cfg .AuthLoginOKPath , "" , "" , true )
74+ response .Redirect (ctx , w , r , authboss .Cfg .AuthLoginOKPath , "" , "" , true )
7575 return nil
7676 }
7777 }
@@ -115,7 +115,7 @@ func (a *Auth) loginHandlerFunc(ctx *authboss.Context, w http.ResponseWriter, r
115115 case authboss .InterruptAccountNotConfirmed :
116116 reason = "Your account has not been confirmed."
117117 }
118- render .Redirect (ctx , w , r , authboss .Cfg .AuthLoginFailPath , "" , reason , false )
118+ response .Redirect (ctx , w , r , authboss .Cfg .AuthLoginFailPath , "" , reason , false )
119119 return nil
120120 }
121121
@@ -125,7 +125,7 @@ func (a *Auth) loginHandlerFunc(ctx *authboss.Context, w http.ResponseWriter, r
125125 if err := authboss .Cfg .Callbacks .FireAfter (authboss .EventAuth , ctx ); err != nil {
126126 return err
127127 }
128- render .Redirect (ctx , w , r , authboss .Cfg .AuthLoginOKPath , "" , "" , true )
128+ response .Redirect (ctx , w , r , authboss .Cfg .AuthLoginOKPath , "" , "" , true )
129129 default :
130130 w .WriteHeader (http .StatusMethodNotAllowed )
131131 }
@@ -157,7 +157,7 @@ func (a *Auth) logoutHandlerFunc(ctx *authboss.Context, w http.ResponseWriter, r
157157 ctx .CookieStorer .Del (authboss .CookieRemember )
158158 ctx .SessionStorer .Del (authboss .SessionLastAction )
159159
160- render .Redirect (ctx , w , r , authboss .Cfg .AuthLogoutOKPath , "" , "" , true )
160+ response .Redirect (ctx , w , r , authboss .Cfg .AuthLogoutOKPath , "You have logged out " , "" , true )
161161 default :
162162 w .WriteHeader (http .StatusMethodNotAllowed )
163163 }
0 commit comments