Skip to content

Commit 837dba5

Browse files
committed
Implementation of refreshToken refs #128
1 parent e425791 commit 837dba5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

app/controllers/InstanceRegistryController.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,19 @@ class InstanceRegistryController @Inject()(implicit system: ActorSystem, mat: Ma
252252
}
253253
}(myExecutionContext)
254254
}
255+
def refreshToken(): Action[AnyContent] = authAction.async
256+
{
257+
request =>
258+
ws.url(instanceRegistryUri + "/users" + "/refreshToken")
259+
.withHttpHeaders(("Authorization", s"Bearer ${AuthProvider.generateJwt()}"))
260+
.post("")
261+
.map { response =>
262+
response.status match {
263+
case 200 =>
264+
Ok(response.body)
265+
case 400 =>
266+
Unauthorized
267+
}
268+
}(myExecutionContext)
269+
}
255270
}

0 commit comments

Comments
 (0)