func ensureNotLoggedIn() gin.HandlerFunc {
	return func(c *gin.Context) {
		u, e := c.Get("username")
		// If the User is logged in, we send him to the Dashboard
		if e {
			username := u.(string)
			if username != "" {
				//Redirection when is logged
				fmt.Println("Redirecting to /dashboard from ensureNotLoggedIn")
				c.Redirect(http.StatusFound, "/dashboard")
			}
		}
	}
}
// Ensures that the user is NOT logged in
Ensures that the user is NOT logged in
// Ensures that the user is NOT logged in
func ensureNotLoggedIn() gin.HandlerFunc {
	return func(c *gin.Context) {
		u, e := c.Get("username")
		if e {
			username := u.(string)
			if username != "" {
				fmt.Println("Redirecting to /dashboard from ensureNotLoggedIn")
				c.Redirect(http.StatusFound, "/dashboard")
			}
		}
	}
}
func ensureNotLoggedIn ( ) gin . HandlerFunc { return func ( c * gin . Context ) { u , e := c . Get ( " " ) if e { username := u . ( string ) if username != " " { fmt . Println ( " " ) c . Redirect ( http . StatusFound , " " ) } } } }
Ensures that the user is NOT logged in
Ensures that the user is NOT logged in
// If the User is logged in, we send him to the Dashboard //Redirection when is logged