I am writing a simple login/logout feature using Beego.
My init()
in router.go
file is given below:
func init() {
beego.Router("/", &controllers.MainController{})
beego.Router("/login", &controllers.AuthController{})
beego.Router("/verify", &controllers.AuthController{}, "post:Verify")
}
In AuthController
:
func (c *AuthController) Verify() {
email := c.GetString("email")
password := c.GetString("password")
fmt.Printf("email: %v password: %v", email, password)
}
I just want to print the details to browser (for debugging purpose) and later redirect it to another page if the user is authenticated. But the issue here is that Beego always looks for a template file and throws the below error:
can't find templatefile in the path:views/authcontroller/verify.tpl
How can I stop Beego from acting like that or am I doing something that is "not-beego-like"?