MCPcopy Index your code
hub / github.com/diffgram/diffgram / enable_otp_from_web

Function enable_otp_from_web

default/methods/user/one_time_pass.py:73–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71
72@routes.route('/api/user/otp/enable', methods=['POST'])
73def enable_otp_from_web():
74
75 with sessionMaker.session_scope() as session:
76
77 user = User.get(session)
78
79 if not user:
80 return "no user", 400, {'ContentType':'application/json'}
81
82 otp, qr_code_url, backup_code_list = OneTimePass.new(session, user)
83
84 out = jsonify( success = True,
85 otp = otp,
86 qr_code_url = qr_code_url,
87 backup_code_list = backup_code_list,
88 user=user.serialize())
89
90 return out, 200, {'ContentType':'application/json'}
91
92
93@routes.route('/api/user/otp/disable', methods=['POST'])

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
newMethod · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected