@app.route('/member/login', methods=['POST', 'GET'])
async def wiki_login(request):
    async with aiofiles.open('data/setting.json', encoding='utf8') as f:
        setting_data = json.loads((await f.read()))
        db = (await aiosqlite.connect((setting_data['db_name'] + '.db')))
    if (request.ctx.session.get('id') == 1):
        return response.redirect('/')
    if (request.method == 'POST'):
        wiki_id = request.form.get('wiki_login_textbox_1', '')
        wiki_password = request.form.get('wiki_login_textbox_2', '')
        wiki_pass_check = (await VerifyAuth(wiki_id, wiki_password, 0))
        if (wiki_pass_check == 1):
            request.ctx.session['id'] = wiki_id
            return response.redirect('/')
        else:
            return response.redirect('/error/')
    return jinja.render('index.html', request, wiki_set=(await wiki_set(request, 0)), data='\n            <form method="post">\n                <input type="text" placeholder="아이디" class="wiki_textbox" name="wiki_login_textbox_1">\n                <hr class="wiki_hr">\n                <input type="password" placeholder="비밀번호" class="wiki_textbox" name="wiki_login_textbox_2">\n                <hr class="wiki_hr">\n                <button type="submit" class="wiki_button" name="wiki_login_button_1">확인</button>\n            </form>\n        ', title='로그인', sub=0, menu=0)
@app.route('/member/login', methods=['POST', 'GET'])
async def wiki_login(request):
    async with aiofiles.open('data/setting.json', encoding='utf8') as f:
        setting_data = json.loads((await f.read()))
        db = (await aiosqlite.connect((setting_data['db_name'] + '.db')))
    if (request.ctx.session.get('id') == 1):
        return response.redirect('/')
    if (request.method == 'POST'):
        wiki_id = request.form.get('wiki_login_textbox_1', )
        wiki_password = request.form.get('wiki_login_textbox_2', )
        wiki_pass_check = (await VerifyAuth(wiki_id, wiki_password, 0))
        if (wiki_pass_check == 1):
            request.ctx.session['id'] = wiki_id
            return response.redirect('/')
        else:
            return response.redirect('/error/')
    return jinja.render('index.html', request, wiki_set=(await wiki_set(request, 0)), data='\n            <form method="post">\n                <input type="text" placeholder="아이디" class="wiki_textbox" name="wiki_login_textbox_1">\n                <hr class="wiki_hr">\n                <input type="password" placeholder="비밀번호" class="wiki_textbox" name="wiki_login_textbox_2">\n                <hr class="wiki_hr">\n                <button type="submit" class="wiki_button" name="wiki_login_button_1">확인</button>\n            </form>\n        ', title='로그인', sub=0, menu=0)