<commit_before>/*eslint-disable*/

const User = require('../models').User;

module.exports = {

    signup(request, response) {
        return User.create({
            email: request.body.email,
            username: request.body.username,
            password: <PASSWORD>,
            firstname: request.body.firstname,
            lastname: request.body.lastname,
            isAuthenticated: false
        }).then((user) => {
            response.status(200).send({
                message: "acount was created successfully",
                Detail: user
            });
        }).catch((error) => response.status(400).send({
            fatal: "An error occured while trying to create user account.",
            Error: error
        }));
    }, // closes createAUserAccount function


    signin(request, response) {
        return User.findOne({
            where: {
                $or: [
                    { username: request.body.username },
                    { email: request.body.email },
                ],
                password: <PASSWORD>
            }
        }).then((user) => {
            if (!user) {
                response.status(401).send({
                    message: 'Access Denied!',
                    details: 'Invalid Username or Password!'
                });
            }
            response.status(200).send({
                message: 'Access granted',
                Details: user
            });
        }).catch((error) => response.status(400).send({
            fatal: "An error occured while trying to sign in a user.",
            Error: error
        }));
    },
}; // closes module.exports Object<commit_msg>completed sign in feature<commit_after>/*eslint-disable*/

const User = require('../models').User;

module.exports = {

    signup(request, response) {
        return User.create({
            email: request.body.email,
            username: request.body.username,
            password: <PASSWORD>,
            firstname: request.body.firstname,
            lastname: request.body.lastname,
            isAuthenticated: false
        }).then((user) => {
            response.status(200).send({
                message: "acount was created successfully",
                Detail: user
            });
        }).catch((error) => response.status(400).send({
            fatal: "An error occured while trying to create user account.",
            Error: error
        }));
    }, // closes createAUserAccount function


}; // closes module.exports Object
{'fraction_non_alphanumeric': 0.12420382165605096, 'fraction_numerical': 0.008359872611464968, 'mean_word_length': 1.551269035532995, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 12, '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': '6254506', 'n_tokens_mistral': 647, 'n_tokens_neox': 607, 'n_words': 147}