Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
Hotfix authentication issue #4860.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpetrick committed Aug 29, 2019
1 parent 1d95a48 commit 62cfeaa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ case class SangriaHandlerImpl(managementApiEnabled: Boolean)(
private def verifyAuth[T](projectId: String, rawRequest: RawRequest)(fn: Project => Future[T]): Future[T] = {
for {
project <- apiDependencies.projectFetcher.fetch_!(projectId)
authResult = apiDependencies.auth.verify(project.secrets, rawRequest.headers.get("Authorization"))
authResult = apiDependencies.auth.verify(project.secrets, rawRequest.headers.get("authorization"))
result <- if (authResult.isSuccess) fn(project) else Future.failed(InvalidToken())
} yield result
}
Expand Down
1 change: 0 additions & 1 deletion server/libs/auth/src/main/scala/com/prisma/auth/Auth.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ object AuthImpl extends Auth {
def verify(secrets: Vector[String], authHeader: String): AuthResult = {
val isValid = secrets.exists { secret =>
val claims = Jwt.decodeRaw(token = authHeader.stripPrefix("Bearer "), key = secret, algorithms = algorithms, options = jwtOptions)
// todo: also verify claims in accordance with https://github.com/graphcool/framework/issues/1365
claims.isSuccess
}
if (isValid) AuthSuccess else AuthFailure
Expand Down

0 comments on commit 62cfeaa

Please sign in to comment.