Skip to content

Commit 7215ab3

Browse files
committed
scala style fixes
1 parent 88d758e commit 7215ab3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/authorization/AuthProvider.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import pdi.jwt.{Jwt, JwtAlgorithm, JwtClaim}
2020
import play.api.Configuration
2121

2222
object AuthProvider {
23-
var token = ""
23+
24+
var Token = "" // scalastyle:ignore
2425

2526
/** This method generates JWT token for registering Delphi-Management at the Instance-Registry
2627
*
@@ -30,16 +31,16 @@ import play.api.Configuration
3031

3132
def generateJwt(validFor: Long = 1)(implicit configuration: Configuration): String = {
3233
val jwtSecretKey = configuration.get[String]("play.http.secret.JWTkey")
33-
if (token == "" || !Jwt.isValid(token, jwtSecretKey, Seq(JwtAlgorithm.HS256))) {
34+
if (Token == "" || !Jwt.isValid(Token, jwtSecretKey, Seq(JwtAlgorithm.HS256))) {
3435
val claim = JwtClaim()
3536
.issuedNow
3637
.expiresIn(validFor * 300)
3738
.startsNow
3839
. +("user_id", configuration.get[String]("play.http.instance"))
3940
. +("user_type", "Admin")
4041

41-
token = Jwt.encode(claim, jwtSecretKey, JwtAlgorithm.HS256)
42+
Token = Jwt.encode(claim, jwtSecretKey, JwtAlgorithm.HS256)
4243
}
43-
token
44+
Token
4445
}
4546
}

app/controllers/InstanceRegistryController.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,4 @@ class InstanceRegistryController @Inject()(implicit system: ActorSystem, mat: Ma
171171
}
172172
}(myExecutionContext)
173173
}
174-
}
174+
}

0 commit comments

Comments
 (0)