more curiouscat connection stuff
This commit is contained in:
parent
affd824913
commit
6405336a58
1 changed files with 16 additions and 0 deletions
16
web.py
16
web.py
|
@ -182,3 +182,19 @@ def create_account():
|
||||||
@app.route('/cc_connect')
|
@app.route('/cc_connect')
|
||||||
def cc_connect():
|
def cc_connect():
|
||||||
return render_template('cc_connect.html')
|
return render_template('cc_connect.html')
|
||||||
|
|
||||||
|
@app.route('/internal/ccc_a', methods=['POST'])
|
||||||
|
def ccc_a(): #step one of curiouscat connection: retreive details
|
||||||
|
r = requests.get("https://curiouscat.me/api/v2/profile?username={}".format(request.form['cc']))
|
||||||
|
j = r.json()
|
||||||
|
if 'error' in j:
|
||||||
|
return redirect('/cc_connect?invalid')
|
||||||
|
session['cctemp'] = {
|
||||||
|
"cc":j['userData']['username'],
|
||||||
|
"ccavi":j['userData']['avatar'],
|
||||||
|
"ccid":j['userData']['id']
|
||||||
|
}
|
||||||
|
|
||||||
|
@app.route('/cc_connect/confirm')
|
||||||
|
def cc_connect_confirm():
|
||||||
|
return render_template('cc_connect_confirm.html', bg="background-image:url('{}')".format(session['cctemp']['ccavi']))
|
||||||
|
|
Loading…
Reference in a new issue