Change log level to DEBUG in beta configuration and improve logging in LoginController.
This commit is contained in:
@@ -84,11 +84,13 @@ public class LoginController implements LoginApi {
|
||||
@Override
|
||||
public ResponseEntity<String> login(String code) {
|
||||
if (code == null) {
|
||||
log.warn("Received null login code");
|
||||
return ResponseEntity.badRequest().build();
|
||||
}
|
||||
|
||||
CacheEntry cacheEntry = cache.get(code);
|
||||
if (cacheEntry == null || cacheEntry.expiry().isBefore(Instant.now())) {
|
||||
log.warn("Received invalid login code {}", code);
|
||||
return ResponseEntity.status(HttpStatus.FORBIDDEN).build();
|
||||
}
|
||||
|
||||
@@ -96,6 +98,7 @@ public class LoginController implements LoginApi {
|
||||
|
||||
cache.remove(code);
|
||||
|
||||
log.debug("Generated token for user {}", cacheEntry.uuid);
|
||||
return ResponseEntity.ok(token);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,4 +5,4 @@ database.host=${DB_HOST:localhost}
|
||||
database.user=${DB_USER:root}
|
||||
database.password=${DB_PASSWORD:root}
|
||||
cors.allowed-origins=${CORS:https://beta.alttd.com}
|
||||
logging.level.com.alttd.altitudeweb=INFO
|
||||
logging.level.com.alttd.altitudeweb=DEBUG
|
||||
|
||||
Reference in New Issue
Block a user