Skip to content

Commit

Permalink
Remove code warnings / unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Brutus5000 committed Oct 4, 2021
1 parent ba6d50e commit 1b4f098
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.faforever.userservice.config

import io.r2dbc.spi.ConnectionFactory
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
Expand All @@ -16,7 +17,7 @@ import java.time.ZoneOffset
@ReadingConverter
class LocalDateTimeToOffsetDateTimeReadingConverter : Converter<LocalDateTime, OffsetDateTime> {
companion object {
private val LOG = LoggerFactory.getLogger(LocalDateTimeToOffsetDateTimeReadingConverter::class.java)
private val LOG: Logger = LoggerFactory.getLogger(LocalDateTimeToOffsetDateTimeReadingConverter::class.java)
}

override fun convert(source: LocalDateTime): OffsetDateTime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.faforever.userservice.hydra.HydraService
import com.faforever.userservice.hydra.RevokeRefreshTokensRequest
import com.faforever.userservice.security.OAuthRole
import com.faforever.userservice.security.OAuthScope
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.format.annotation.DateTimeFormat
import org.springframework.http.HttpStatus
Expand Down Expand Up @@ -41,14 +42,13 @@ class OAuthController(
private val fafProperties: FafProperties,
) {
companion object {
val LOG = LoggerFactory.getLogger(OAuthController::class.java)
val LOG: Logger = LoggerFactory.getLogger(OAuthController::class.java)
const val LOGIN_TECHNICAL_ERROR_ROUTE = "login/technicalError"
}

@GetMapping("/login")
fun showLogin(
request: ServerHttpRequest,
response: ServerHttpResponse,
@RequestParam("login_challenge") challenge: String,
model: Model,
): Mono<Rendering> =
Expand Down Expand Up @@ -116,8 +116,6 @@ class OAuthController(

@GetMapping("/consent")
fun showConsent(
request: ServerHttpRequest,
response: ServerHttpResponse,
@RequestParam("consent_challenge", required = true) challenge: String,
model: Model,
): Mono<Rendering> =
Expand Down Expand Up @@ -164,7 +162,6 @@ class OAuthController(
@PreAuthorize("hasRole('${OAuthRole.ADMIN_ACCOUNT_BAN}') and @scopeService.hasScope(authentication, '${OAuthScope.ADMINISTRATIVE_ACTION}')")
fun revokeRefreshTokens(
@RequestBody revokeRefreshTokensRequest: RevokeRefreshTokensRequest,
request: ServerHttpRequest,
response: ServerHttpResponse,
): Mono<Void> {
LOG.info(
Expand All @@ -177,7 +174,6 @@ class OAuthController(

@GetMapping("/banned")
fun showBan(
request: ServerHttpRequest,
@RequestParam("reason", required = true) reason: String,
@RequestParam("expiration") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) expiration: OffsetDateTime?,
model: Model,
Expand All @@ -190,7 +186,6 @@ class OAuthController(

@GetMapping("/gameVerificationFailed")
fun showOwnershipVerification(
request: ServerHttpRequest,
model: Model,
): Mono<Rendering> {
model.addAttribute("accountLink", fafProperties.accountLinkUrl)
Expand All @@ -199,7 +194,6 @@ class OAuthController(

@GetMapping("/$LOGIN_TECHNICAL_ERROR_ROUTE")
fun showLoginTechnicalError(
request: ServerHttpRequest,
model: Model,
): Mono<Rendering> =
Rendering.view("oauth2/loginTechnicalError").build().toMono()
Expand Down

0 comments on commit 1b4f098

Please sign in to comment.