Now that we have our Session, our Login component, and our System configuration, we need to hook it into the web application.

In this case, I use a WATask subclass:

WATask subclass: #TGMilestonePMApp
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Techgame-Seaside'

with the following go method:

go
	self hasUser ifFalse: [self session user: (self call: TGWLogin new)].
	self call: (YourCoolAppComponent new).

... this depends on hasUser

hasUser
	^ self session user notNil

don't forget a class side method:

canBeRoot
   ^ true

How does this work?

The go method gets invoked, checks hasUser; this will be nil if no one is logged in, including when the Session times out. If the user is nil, then a new TGWLogin component is called, which checks the password and user name, returning the valid User object. This User object is stored in the session. The the main app component is called: into. When the session times out, the next request starts with the go method again, and we start all over.

Back: Login Component
Top: Using GOODS with Seaside