jwt.exceptions.DecodeError
jwt.exceptions.DecodeError: Invalid token type. Token must be a <class 'bytes'>
토큰을 디코드 해야되는데 유효하지 않은 토큰이라고한다. 추가적으로 알 수 있는 부분은 토큰은 bytes클래스여야 하나보다. 따라서 아래의 구문으로 빠지기 때문에
except jwt.exceptions.DecodeError:
return redirect(url_for("login", msg="로그인 정보가 존재하지 않습니다."))
except jwt.exceptions.DecodeError:
return jsonify({'result': 'fail', 'msg': "로그인이 필요합니다!"})
차이점 알아보기