func login(w http.ResponseWriter, r *http.Request) (err error) {
	params := map[string]string{
		"email": r.URL.Query().Get(":email"),
	}
	fields := InputFields(r)
	for key, values := range fields {
		params[key] = values[0]
	}
	token, err := app.AuthScheme.Login(params)
	if err != nil {
		return handleAuthError(err)
	}
	return json.NewEncoder(w).Encode(map[string]string{"token": token.GetValue()})
}
func login(w http.ResponseWriter, r *http.Request) (err error) {
	params := map[string]string{
		"email": r.URL.Query().Get(":email"),
	}
	fields := InputFields(r)
	for key, values := range fields {
		params[key] = values[0]
	}
	token, err := app.AuthScheme.Login(params)
	if err != nil {
		return handleAuthError(err)
	}
	return json.NewEncoder(w).Encode(map[string]string{"token": token.GetValue()})
}
func login ( w http . ResponseWriter , r * http . Request ) ( err error ) { params := map [ string ] string { " " : r . URL . Query ( ) . Get ( " " ) , } fields := InputFields ( r ) for key , values := range fields { params [ key ] = values [ 0 ] } token , err := app . AuthScheme . Login ( params ) if err != nil { return handleAuthError ( err ) } return json . NewEncoder ( w ) . Encode ( map [ string ] string { " " : token . GetValue ( ) } ) }
// title: login
// path: /auth/login
// method: POST
// consume: application/x-www-form-urlencoded
// produce: application/json
// responses:
//   200: Ok
//   400: Invalid data
//   401: Unauthorized
//   403: Forbidden
//   404: Not found
title : login path : / auth / login method : POST consume : application / x - www - form - urlencoded produce : application / json responses : 200 : Ok 400 : Invalid data 401 : Unauthorized 403 : Forbidden 404 : Not found