public inbox for [email protected]
 help / color / mirror / Atom feed
From: Alviro Iskandar Setiawan <[email protected]>
To: "Fernanda Ma'rouf" <[email protected]>,
	Akiekano <[email protected]>
Cc: "GNU/Weeb Mailing List" <[email protected]>,
	 Alviro Iskandar Setiawan <[email protected]>
Subject: [PATCH buubuu v1 0/5] Login and Register page
Date: Sat, 28 May 2022 03:34:07 +0700	[thread overview]
Message-ID: <CAOG64qNDyrKyV_TqTdP6pdVAyTn1=hRppnOoJ=e9T73C9Nsjmg@mail.gmail.com> (raw)

Hi,

This series adds a Login and Register page. There are 5 patches:

## Patch 1 and 2
Create these two view files:

   register.html
   login.html

Both of them will generate an XHR request upon form submission. The
content type of the request body will be in JSON format. The backend
then can later consume this JSON data that's sent by the frontend.

## Patch 3
Make Register() function in the auth-controller render the previously
created view, register.html. Only render this file when the user
visits this endpoint with HTTP method "GET".

## Patch 4
Make Login() function in the auth-controller render the previously
created view, login.html. Only render this file when the user visits
this endpoint with HTTP method "GET".

## Patch 5
Add these two routes:

   /auth/login POST authController.Register
   /auth/login GET  authController.login

for the login page and API endpoint.


Note:
Currently, the backend doesn't handle the JSON data sent by the
frontend. This is only the starting point where the frontend
sends the JSON data via a JavaScript XHR.

That's all. Please review, tq!

Signed-off-by: Alviro Iskandar Setiawan <[email protected]>
---
Alviro Iskandar Setiawan (5):
  view: Create register.html
  view: Create login.html
  auth-controller: Register: Render register.html on HTTP GET request
  auth-controller: Login: Render login.html on HTTP GET request
  server: auth: Create `/login` route

 controller/auth-controller.go | 13 ++++-
 server.go                     |  2 +
 view/login.html               | 70 +++++++++++++++++++++++++++
 view/register.html            | 84 +++++++++++++++++++++++++++++++++
 4 files changed, 168 insertions(+), 1 deletion(-)
 create mode 100644 view/login.html
 create mode 100644 view/register.html

base-commit: 0bcec53449298abf84a135435e6df95dfabcf5d6
-- 
Alviro Iskandar Setiawan

             reply	other threads:[~2022-05-27 20:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27 20:34 Alviro Iskandar Setiawan [this message]
2022-05-27 20:39 ` [PATCH buubuu v1 1/5] view: Create register.html Alviro Iskandar Setiawan
2022-05-27 20:39 ` [PATCH buubuu v1 2/5] view: Create login.html Alviro Iskandar Setiawan
2022-05-27 20:39 ` [PATCH buubuu v1 3/5] auth-controller: Register: Render register.html on HTTP GET request Alviro Iskandar Setiawan
2022-05-27 20:39 ` [PATCH buubuu v1 4/5] auth-controller: Login: Render login.html " Alviro Iskandar Setiawan
2022-05-27 20:39 ` [PATCH buubuu v1 5/5] server: auth: Create `/login` route Alviro Iskandar Setiawan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOG64qNDyrKyV_TqTdP6pdVAyTn1=hRppnOoJ=e9T73C9Nsjmg@mail.gmail.com' \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox