[Python]PyJWT 파이썬에서 JWT 사용하기
2022. 6. 29. 11:51
python
PyJWT 설치 pip install pyjwt 토큰을 만드는 예제 @app.route('/sign_in', methods=['POST']) def sign_in(): # 로그인 username_receive = request.form['username_give'] password_receive = request.form['password_give'] pw_hash = hashlib.sha256(password_receive.encode('utf-8')).hexdigest() result = db.users.find_one({'username': username_receive, 'password': pw_hash}) if result is not None: payload = { 'id': username..