0

I'm trying to set up basic auth and testing with postman. The code snippet below returns null when tested with Postman with Username and Password set correctly in the Basic Auth section. If I replace the hug.authentication.verify with my own function, it isn't even called (tested by putting print statements in). If I print user it shows as None on the console.

authentication = hug.authentication.basic(hug.authentication.verify("gordy","emily"))

@hug.get()
def token(user: hug.directives.user, requires=authentication):
    return user
James Wilson
  • 852
  • 13
  • 29

1 Answers1

0

The requires=authentication needs to go inside the hug.get decorator.

James Wilson
  • 852
  • 13
  • 29