User Sessions
Non-Logged in Users in .init()
introduction in init() , if username=null , the flow below determines how socratease proceeds there are two further parameters in the session authentication key that determine how socratease handles such sessions with allow unauthenticated sessions=false , the socratease library will return a 401 error with remember unauthenticated sessions=true , even if the user closes tabs or the browser when they load your property, socratease will restore their session code const payload = { 'username' null, 'session authentication' { 'allow unauthenticated sessions' true, 'remember unauthenticated sessions' false } } the flow graph td; a{username=null?} a > |no | a1\[create/load user with given username] a1 > g\[return is registered=true] g > b\[store jwt inside react] a > |yes | c{allowunauthenticatedsessions?} c > |no | d\[return 401] c > |yes | e\[create user with random username] e > i\[returns is registered=false] i > j{rememberunauthenticatedsessions?} j > |yes | k\[store jwt as cookie] j > |no |h1\[store jwt as sessionvariable]