示例#1
0
def authcode(alexaId):

	code = request.args.get('code')
	userId = myApp.getUserIdFromAlexaId(alexaId)

	if st.smartThingsToken(alexaId, userId,code):

		print st.stData.getUser(userId).getClientInfo().token

		myApp.genNewAlexaId(userId,100)

	return redirect("/alexa")
示例#2
0
def authcode(alexaId):

    code = request.args.get('code')
    userId = myApp.getUserIdFromAlexaId(alexaId)

    if st.smartThingsToken(alexaId, userId, code):

        print st.stData.getUser(userId).getClientInfo().token

        myApp.genNewAlexaId(userId, 100)

    return redirect("/alexa")
示例#3
0
def authcode(alexaId):

	code = request.args.get('code')
	userId = myApp.getUserIdFromAlexaId(alexaId)

	if st.smartThingsToken(alexaId, userId,code):

		print "authed..."
		#print st.stData.getUser(userId).getClientInfo().token

		myApp.genNewAlexaId(userId,100)
		sendWelcomeEmail(userId)

	return redirect(settings.url_root)
示例#4
0
文件: echopy.py 项目: cfortan/Nest
def authcode(alexaId):

    code = request.args.get('code')
    userId = myApp.getUserIdFromAlexaId(alexaId)

    if st.smartThingsToken(alexaId, userId, code):

        print "authed..."
        #print st.stData.getUser(userId).getClientInfo().token

        myApp.genNewAlexaId(userId, 100)
        sendWelcomeEmail(userId)

    return redirect(settings.url_root)