Example #1
0
def login_action():

    email = request.form['email']
    password = request.form['password']
    print(email, password)
    data = {}
    result = mongo.Login(email, password)
    if result['check']:
        session['email'] = email
        session['name'] = result['name']

        data['check'] = True
        data['link'] = "/dashboard"

    return data
Example #2
0
def login_action():

    email = request.form['email']
    password = request.form['password']
    print(email, password)
    data = mongo.Login(email, password)

    link_map = {"Investor": '/capital', "Enterprise": "/company"}

    if data['check']:
        data['link'] = link_map[data['category']]
        session['name'] = data['name']
        session['category'] = data['category']
        session['hash'] = data['hash']
        return data
    return data
Example #3
0
File: app.py Project: mg4603/daiict
def login_action():

    email = request.form['email']
    password = request.form['password']
    print(email, password)
    data = mongo.Login(email, password)

    link_map = {'SME': '/sme', 'CE': '/ce', "Capitalist": '/capital'}

    if data['check']:
        data['link'] = link_map[data['category']]
        session['name'] = data['name']
        session['category'] = data['category']
        session['hash'] = data['hash']
        return data
    return data
Example #4
0
def login_action():

    email = request.form['email']
    password = request.form['password']
    check, role = mongo.Login(email, password)
    if check:
        print("User exists")
        session['email'] = email
        if role == "Teacher":
            session['game'] = "True"
            print("game editing")
        print("session started")
        print(role)
        return "Success"
    else:
        print("User Does not exists")

        return {"error": "User does not exists"}
Example #5
0
def LoginAction():
    email = request.form['email']
    password = request.form['password']
    
    response = {}
    result = mongo.Login(email,password)
    if result['check']:
        
        session['email'] = email
        session['name'] = result['name'] 
        session['category'] = result['category']

        response['check'] = True

        if result['category'] == "CloudProvider":
            response['link'] = '/CloudProvider'
        else:
            response['link'] = '/dashboard' 

    return response