Mercurial > openid
view tests/utest.ur @ 63:089ad1d33e2f
Fix to track a change in Ur/Web's 'table' signature item syntactic sugar
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Wed, 06 Nov 2013 18:25:51 -0500 |
parents | 9f392276d614 |
children |
line wrap: on
line source
style inputs structure U = OpenidUser.Make(struct con cols = [Nam = string] val sessionLifetime = 3600 val afterLogout = bless "/main" val secureCookies = False val association = Openid.Stateful {AssociationType = Openid.HMAC_SHA256, AssociationSessionType = Openid.NoEncryption} val realm = Some "http://localhost:8080/" val creationState = n <- source ""; return {Nam = n} fun render r = <xml> <tr> <th class={inputs}>Name:</th> <td><ctextbox source={r.Nam}/></td> </tr> </xml> fun ready _ = return True fun tabulate r = n <- signal r.Nam; return {Nam = n} fun choose _ r = return (OpenidUser.Success r) val formClass = inputs val fakeId = None structure CtlDisplay = OpenidUser.DefaultDisplay end) fun wrap titl bod = userStuff <- U.main wrap; return <xml><head> <title>{[titl]}</title> </head><body> {userStuff.Status}<br/> {userStuff.Other.Xml} <h1>{[titl]}</h1> {bod} </body></xml> fun main () = whoami <- U.current; wrap "Main page" (case whoami of None => <xml>I don't think you're logged in.</xml> | Some whoami => <xml>Apparently you are <b>{[whoami]}</b>!</xml>)