Fixed broked User Login
Cette révision appartient à :
Parent
7f053c978d
révision
95cb6683b2
2 fichiers modifiés avec 4 ajouts et 2 suppressions
|
@ -33,6 +33,7 @@ func init() {
|
|||
gzipUserVerifyEmailHandler := handlers.CompressHandler(http.HandlerFunc(UserVerifyEmailHandler))
|
||||
gzipUserRegisterPostHandler := handlers.CompressHandler(http.HandlerFunc(UserRegisterPostHandler))
|
||||
gzipUserLoginPostHandler := handlers.CompressHandler(http.HandlerFunc(UserLoginPostHandler))
|
||||
gzipUserProfileHandler := handlers.CompressHandler(http.HandlerFunc(UserProfileHandler))
|
||||
|
||||
Router = mux.NewRouter()
|
||||
|
||||
|
@ -57,6 +58,7 @@ func init() {
|
|||
Router.Handle("/verify/email/{token}", gzipUserVerifyEmailHandler).Name("user_verify").Methods("GET")
|
||||
Router.Handle("/user/register", gzipUserRegisterPostHandler).Name("user_register").Methods("POST")
|
||||
Router.Handle("/user/login", gzipUserLoginPostHandler).Name("user_login").Methods("POST")
|
||||
Router.Handle("/user/{id}/{username}", gzipUserProfileHandler).Name("user_profile").Methods("GET")
|
||||
Router.PathPrefix("/captcha").Methods("GET").HandlerFunc(captcha.ServeFiles)
|
||||
|
||||
Router.NotFoundHandler = http.HandlerFunc(NotFoundHandler)
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
{{with .User}}
|
||||
<li class="dropdown">
|
||||
{{if gt .Id 0}}
|
||||
<a href="{{ genRoute "user_profile" "id" (print .Id) }}" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<a href="{{ genRoute "user_profile" "id" (print .Id) "username" .Username }}" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<img src="https://www.gravatar.com/avatar/{{ .Md5 }}?s=50" class="profile-image img-circle"> {{ .Username }} <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{ genRoute "user_profile" "id" (print .Id) }}"><i class="fa fa-cog"></i> Profile</a></li>
|
||||
<li><a href="{{ genRoute "user_profile" "id" (print .Id) "username" .Username }}"><i class="fa fa-cog"></i> Profile</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#soon"><i class="fa fa-sign-out"></i> Sign-out</a></li>
|
||||
</ul>
|
||||
|
|
Référencer dans un nouveau ticket