@@ -37,6 +37,10 @@ func ConfigureLoginRoute(route httproute.Route) httproute.Route {
3737 WithPathPattern ("/login" )
3838}
3939
40+ type TutorialCookie interface {
41+ Pop (r * http.Request , rw http.ResponseWriter , name httputil.TutorialCookieName ) bool
42+ }
43+
4044type LoginViewModel struct {
4145 AllowLoginOnly bool
4246}
@@ -47,6 +51,7 @@ type LoginHandler struct {
4751 FormPrefiller * FormPrefiller
4852 Renderer Renderer
4953 AnalyticService AnalyticService
54+ TutorialCookie TutorialCookie
5055}
5156
5257func (h * LoginHandler ) GetData (r * http.Request , rw http.ResponseWriter , graph * interaction.Graph , allowLoginOnly bool ) (map [string ]interface {}, error ) {
@@ -56,6 +61,9 @@ func (h *LoginHandler) GetData(r *http.Request, rw http.ResponseWriter, graph *i
5661 AllowLoginOnly : allowLoginOnly ,
5762 }
5863 viewmodels .EmbedForm (data , r .Form )
64+ if h .TutorialCookie .Pop (r , rw , httputil .SignupLoginTutorialCookieName ) {
65+ baseViewModel .SetTutorial (httputil .SignupLoginTutorialCookieName )
66+ }
5967 viewmodels .Embed (data , baseViewModel )
6068 authenticationViewModel := viewmodels .NewAuthenticationViewModelWithGraph (graph )
6169 viewmodels .Embed (data , authenticationViewModel )
0 commit comments