<commit_before>import datetime
from flask.ext.restful import Resource, fields, marshal
from flask import request, current_app
from passlib.hash import bcrypt

from ..services import users
from ..core import auth

user_fields = {
    'email': fields.String,
    'id': fields.Integer,
    'registered_at' : fields.DateTime
}

class UserAPI(Resource):
    """
    API :class:`Resource` for a returning the details of a user.
    This endpoint can be used to verify a user login credentials.
    """
    
    decorators = [auth.login_required]
    def get(self, email):
        user = users.request_user()
        return marshal(user, user_fields)
        
class RegisterAPI(Resource):
    """API :class:`Resource` for a registering a new user."""
    <commit_msg>Fixed bug with the user credential check endpoint<commit_after>import datetime
from flask.ext.restful import Resource, fields, marshal
from flask import request, current_app
from passlib.hash import bcrypt

from ..services import users
from ..core import auth

user_fields = {
    'email': fields.String,
    'id': fields.Integer,
    'registered_at' : fields.DateTime
}

class UserAPI(Resource):
    """
    API :class:`Resource` for a returning the details of a user.
    This endpoint can be used to verify a user login credentials.
    """
    
    decorators = [auth.login_required]
    def get(self):
        user = users.request_user()
        return marshal(user, user_fields)
        
class RegisterAPI(Resource):
    """API :class:`Resource` for a registering a new user."""
    
{'fraction_non_alphanumeric': 0.09489993544222079, 'fraction_numerical': 0.0, 'mean_word_length': 3.3417366946778713, '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': '1531667', 'n_tokens_mistral': 437, 'n_tokens_neox': 430, 'n_words': 156}