purescript-webrow / webrow

Let's build a highly opinionated but fully-featured web framework in PureScript
BSD 3-Clause "New" or "Revised" License
23 stars 0 forks source link

Auth applet #6

Closed Kamirus closed 4 years ago

Kamirus commented 4 years ago

/login -> login form: email & password

/login?email&password -> check success -> create session -> OnSuccessfulLogin (Response -> Response) HTTPure.Response set cookie redirect login successful ()

/login?email&password -> check failure -> response LoginFailed

loginRequired - check whether the user is logged in

withLoginRequired do
  ...

/logout - similarly to the OnSuccessfulLogin remove cookie

paluh commented 4 years ago

We can also think about:

GET: /password-change -> password form: old password & new1 & new2 POST: /password-change -> check failure -> password form: ... POST: /password-change -> check success -> OnSuccessfulPasswordChange ..

Form representation and validation is a separate topic which we are going to explore soon too :-)

paluh commented 4 years ago

We can say that initial prototyping phase is behind us:

https://github.com/purescript-webrow/webrow/tree/master/src/WebRow/Applets