feat: implement authentication register finish endpoint

This commit is contained in:
Prad Nukala
2024-10-23 09:52:07 -04:00
parent 2479bae12e
commit 7cbc9e0bb1
4 changed files with 30 additions and 21 deletions
@@ -6,18 +6,21 @@ import (
"github.com/onsonr/sonr/pkg/nebula/global/styles"
)
// RegisterModal returns the Register Modal.
templ RegisterModal(c echo.Context) {
@styles.OpenModal("Account Registration", "Enter your account information below to create your account.") {
@sections.RegisterStart()
}
}
// LoginModal returns the Login Modal.
templ LoginModal(c echo.Context) {
@styles.OpenModal("Account Registration", "Enter your account information below to create your account.") {
@sections.LoginStart()
}
}
// AuthorizeModal returns the Authorize Modal.
templ AuthorizeModal(c echo.Context) {
@styles.OpenModal("Account Registration", "Enter your account information below to create your account.") {
@sections.AuthorizeStart()
@@ -11,6 +11,7 @@ import (
// │ DWN Routes - Authentication │
// ╰───────────────────────────────────────────────────────────╯
// CurrentViewRoute returns the current view route.
func CurrentViewRoute(c echo.Context) error {
s, err := ctx.GetDWNContext(c)
if err != nil {
@@ -24,14 +25,17 @@ func CurrentViewRoute(c echo.Context) error {
// │ Hway Routes - Authentication │
// ╰───────────────────────────────────────────────────────────╯
// AuthorizeModalRoute returns the Authorize Modal route.
func AuthorizeModalRoute(c echo.Context) error {
return ctx.RenderTempl(c, AuthorizeModal(c))
}
// LoginModalRoute returns the Login Modal route.
func LoginModalRoute(c echo.Context) error {
return ctx.RenderTempl(c, LoginModal(c))
}
// RegisterModalRoute returns the Register Modal route.
func RegisterModalRoute(c echo.Context) error {
return ctx.RenderTempl(c, RegisterModal(c))
}
+13 -13
View File
@@ -2,22 +2,22 @@ package authentication
import echo "github.com/labstack/echo/v4"
// CurrentView checks if the user is logged in.
templ CurrentView(c echo.Context) {
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Current Account</h3>
</div>
<div class="card-body">
<p class="card-text">
<a href="/logout">Logout</a>
</p>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Current Account</h3>
</div>
<div class="card-body">
<p class="card-text">
<a href="/logout">Logout</a>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
}