<commit_before>package controllers

import (
    "github.com/revel/revel"
    "encoding/json"
    "io/ioutil"
    //"github.com/ip4368/go-password"
    "github.com/ip4368/go-userprofile"
)

type Users struct {
    *revel.Controller
}

type RegisterProfile struct {
    Username string `json:"username"`
    Password string `json:"password"`
    Email string `json:"email"`
}

func (c *Users) Register() revel.Result {
	// read request body to byte
	var r RegisterProfile
	var bodyBytes []byte
	if c.Request.Body != nil {
		bodyBytes, _ = ioutil.ReadAll(c.Request.Body)
	}
	json.Unmarshal([]byte(bodyBytes), &r)

	//password.ValidatePassword(r.Password)
	userprofile.ValidateEmail(r.Email)
	userprofile.ValidateUsername(r.Username)
	return c.Render()
}

func (c *Users) Login() revel.Result {
	// read request body to byte<commit_msg>make check password<commit_after>package controllers

import (
    "github.com/revel/revel"
    "encoding/json"
    "io/ioutil"
    "github.com/ip4368/go-password"
    "github.com/ip4368/go-userprofile"
)

type Users struct {
    *revel.Controller
}

type RegisterProfile struct {
    Username string `json:"username"`
    Password string `json:"password"`
    Email string `json:"email"`
}

func (c *Users) Register() revel.Result {
	// read request body to byte
	var r RegisterProfile
	var bodyBytes []byte
	if c.Request.Body != nil {
		bodyBytes, _ = ioutil.ReadAll(c.Request.Body)
	}
	json.Unmarshal([]byte(bodyBytes), &r)

	password.ValidatePassword(r.Password)
	userprofile.ValidateEmail(r.Email)
	userprofile.ValidateUsername(r.Username)
	return c.Render()
}

func (c *Users) Login() revel.Result {
	// read request body to byte
{'fraction_non_alphanumeric': 0.13069544364508393, 'fraction_numerical': 0.009592326139088728, 'mean_word_length': 3.9525222551928785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '83940', 'n_tokens_mistral': 577, 'n_tokens_neox': 562, 'n_words': 125}