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 will return a Signal that will be updated when the user state changes.

This method will return a Signal that will be updated when the user state changes.

It takes two arguments to produce a value depending on the user state

Value parameters

withSession

the value to produce when the user is logged in

withoutSession

the value to produce when the user is not logged in

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 returns true user is active.

This method returns true user is active.

Attributes

def loadUserState(): Unit

Load the user state from the storage with Same Origin issuer. This method is used to log in the user.

Load the user state from the storage with Same Origin issuer. This method is used to log in the user.

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]]

Concrete fields

val userState: Var[Option[UserToken]]