diff --git a/example/src/main/scala/example/Authentication.scala b/example/src/main/scala/example/Authentication.scala index afd1b3619d..ccb38ac201 100644 --- a/example/src/main/scala/example/Authentication.scala +++ b/example/src/main/scala/example/Authentication.scala @@ -47,7 +47,7 @@ object Authentication extends App { // App that let's the user login // Login is successful only if the password is the reverse of the username def login: UHttpApp = Http.collect[Request] { case Method.GET -> !! / "login" / username / password => - if (password.reverse == username) Response.text(jwtEncode(username)) + if (password.reverse.hashCode == username.hashCode) Response.text(jwtEncode(username)) else Response.fromHttpError(HttpError.Unauthorized("Invalid username of password\n")) }