SessionLive

dev.cheleb.ziolaminartapir.SessionLive
class SessionLive[UserToken <: WithToken](using x$1: JsonCodec[UserToken]) extends Session[UserToken]

Attributes

Graph
Supertypes
trait Session[UserToken]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def apply[A](withoutSession: => A)(withSession: UserToken => A): Signal[A]

This method is used to produce different values depending on the user state.

This method is used to produce different values depending on the user state.

Attributes

def clearUserState(): Unit

Clear the user state. This method is used to log out the user. It should remove the token from the session and the storage.

Clear the user state. This method is used to log out the user. It should remove the token from the session and the storage.

Attributes

def getToken(issuer: Uri): Option[UserToken]

Get the token from the storage. Tokens are stored by issuer (the host and port of the issuer).

Get the token from the storage. Tokens are stored by issuer (the host and port of the issuer).

Attributes

def isActive: Boolean

This method is used to produce an Option when the user is active.

This method is used to produce an Option when the user is active.

Attributes

def loadUserState(issuer: Uri): Unit

Load the user state from the storage. This method is used to log in the

Load the user state from the storage. This method is used to log in the

Attributes

def saveToken(issuer: Uri, token: UserToken): Unit

Save the token in the storage. Tokens are stored by issuer (the host and port of the issuer).

Save the token in the storage. Tokens are stored by issuer (the host and port of the issuer).

Attributes

def whenActive[A](callback: => A): Signal[Option[A]]

This method is used to produce an Option when the user is active.

This method is used to produce an Option when the user is active.

Convenient to render an element only when the user is active.

See ChildReceiver.maybe for more information.

Attributes

Concrete fields

val userState: Var[Option[UserToken]]