feat(user-sessions): implement user login, logout, and session management

This commit is contained in:
2025-10-28 18:32:57 +01:00
parent e2c4da68ca
commit 93b0766138
9 changed files with 186 additions and 4 deletions

View File

@@ -0,0 +1,28 @@
package logic.user.impl
import com.typesafe.config.Config
import logic.user.SessionManager
import model.users.User
import javax.inject.{Inject, Singleton}
@Singleton
class BaseSessionManager @Inject()(val config: Config) extends SessionManager {
override def createSession(user: User): String = {
//TODO create JWT token instead of random string
//Write session identifier to cache and DB
val sessionId = java.util.UUID.randomUUID().toString
sessionId
}
override def getUserBySession(sessionId: String): Option[User] = {
//TODO verify JWT token instead of looking up in cache
//Read session identifier from cache and DB
None
}
override def invalidateSession(sessionId: String): Unit = {
}
}