@@ -0,0 +1,692 @@
+form flask_httpauth import HTTPBasicAuth%0Afrom i.errors import forbidden%0A%0Aauth = HTTPBasicAuth()%0A%0A@auth.verify_password%0Adef verify_password(email, password):%0A    if email == '':%0A        g.current_user = AnonymousUser()%0A        return True%0A    user = User.query.filter_by(email = email).first()%0A    if not user:%0A        return False%0A    g.current_user = user%0A    return user.verify_password(password)%0A    %0A@auth.error_handler%0Adef auth_error():%0A    return unauthorized('Invalid credentials')%0A    %0A@api.before_request%0A@auth.login_required%0Adef before_request():%0A    if not g.current_user.is_anonymous and %5C%0A            not g.current_user.confirmed:%0A        return forbidden('Unconfirmed account')%0A

Create authentication.py