Skip to content

IndexHTML #44

Answered by benbjohnson
menzhessarov asked this question in Q&A
Discussion options

You must be logged in to vote

Good question. The index.html asset is for the static home page when the user is logged out. The index.ego is a template that renders the logged in view.

wtf/http/server.go

Lines 424 to 434 in 63b98f9

// If user is not logged in & application is built with a home page,
// return the home page. Otherwise redirect to login.
if wtf.UserIDFromContext(r.Context()) == 0 {
if buf := assets.IndexHTML; len(buf) != 0 {
w.Write(buf)
return
}
http.Redirect(w, r, "/login", http.StatusFound)
return
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by benbjohnson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants