@@ -129,12 +129,12 @@ def decorated(*args, **kwargs):
129129 raise AuthError ({"code" : "invalid_header" ,
130130 "description" :
131131 "Unable to parse authentication"
132- " token." }, 400 )
132+ " token." }, 401 )
133133
134134 _request_ctx_stack .top .current_user = payload
135135 return f (* args , ** kwargs )
136136 raise AuthError ({"code" : "invalid_header" ,
137- "description" : "Unable to find appropriate key" }, 400 )
137+ "description" : "Unable to find appropriate key" }, 401 )
138138 return decorated
139139
140140
@@ -144,7 +144,7 @@ def decorated(*args, **kwargs):
144144def public ():
145145 """No access token required to access this route
146146 """
147- response = "All good. You don't need to be authenticated to call this"
147+ response = "Hello from a public endpoint! You don't need to be authenticated to see this. "
148148 return jsonify (message = response )
149149
150150
@@ -155,7 +155,7 @@ def public():
155155def private ():
156156 """A valid access token is required to access this route
157157 """
158- response = "All good. You only get this message if you're authenticated"
158+ response = "Hello from a private endpoint! You need to be authenticated to see this. "
159159 return jsonify (message = response )
160160
161161
@@ -167,11 +167,11 @@ def private_scoped():
167167 """A valid access token and an appropriate scope are required to access this route
168168 """
169169 if requires_scope ("read:messages" ):
170- response = "All good. You're authenticated and the access token has the appropriate scope "
170+ response = "Hello from a private endpoint! You need to be authenticated and have a scope of read:messages to see this. "
171171 return jsonify (message = response )
172172 raise AuthError ({
173- "code" : "Anauthorized " ,
174- "desciption " : "You don't have access to this resource"
173+ "code" : "Unauthorized " ,
174+ "description " : "You don't have access to this resource"
175175 }, 403 )
176176
177177
0 commit comments