/members/superusers

The requested page has been restricted to Members Only

Member Login

This page uses an HTML Form that posts to a Hashtag Markup Sign-In Page.   The Form is styled using Bootstrap 3 default theme classes.   If the Username and Password are validated, the Username is stored in the current Session,  Hashtag Access is granted for Security Groups,  and the request is redirected back to the Restricted Page.  

Processed this Hashtag Markup on the Restricted Page: /members/superusers
<# restrict access to members using /members/auth; #>
Note:  The request was redirected here because this Session has not been granted members access.



Processed this Hashtag Markup:
<form action="sign-in?restricted_page=<#[url.restricted_page as html]#>"
	method="post" class="form-horizontal">
	<div class="form-group">
		<label for="username" class="col-sm-2 control-label">Username</label>
		<div class="col-sm-5">
			<input type="text" name="username" required class="form-control" id="username">
		</div>
	</div>
	<div class="form-group">
		<label for="password" class="col-sm-2 control-label">Password</label>
		<div class="col-sm-5">
			<input type="password" name="password" required class="form-control" id="password">
		</div>
	</div>
	<div class="form-group">
		<div class="col-sm-offset-2 col-sm-5">
			<input type="submit" class="btn btn-primary" value="Sign In">
		</div>
	</div>
</form>

Hashtag Markup for Sign-In page: /members/sign-in.htmx
<#: look up the member ID so it can salt the password for hashing :#>
<# start list for members;
	include when username is "<#[post.username]#>";
#>
<# set member.id to "<# id #>"; #>
<# end list #>

<# start list for members;
	include when username is "<#[post.username]#>" 
		and password is "<#[post.password as hash salted by member.id]#>";
	relate id to group_memberships.member_id;
	relate group_memberships.group_id to groups.id;
#>

<# start header #>
<# set session.username to "<#[post.username]#>"; #>
<# grant access to members; #>
<# end header #>

<# start row #>
<# grant access to <# groups.name #>; #>
<# end row #>

<# start footer #>
<# redirect to "<#[url.restricted_page]#>"; #>
<# end footer #>

<# start no results #>
<# redirect to "/members/auth?message=invalid&restricted_page=<#[url.restricted_page as url]#>"; #>
<# end no results #>

<# end list #>

The Members Mini-App uses the Hashtag Markup Language to demonstrate a user authentication process for #WebApps.

Member, Group, and Group Membership records are all stored in an SQL Database.   Methods are provided to create, update, and delete all of these records.  

Members Only pages restrict access based on group membership.