feat(oauth,twitter): default oauth2 implementation

This commit is contained in:
Gustavo "Guz" L. de Mello
2024-07-24 18:43:23 -03:00
parent e663abe150
commit cd2f58a24c
7 changed files with 201 additions and 93 deletions

View File

@@ -3,6 +3,7 @@ package routes
import (
"extrovert/templates/layouts"
"extrovert/components"
"extrovert/internals/app"
"net/http"
"extrovert/internals/router/errors"
e "errors"
@@ -12,6 +13,7 @@ type Homepage struct{}
func (h Homepage) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
err := h.page().Render(context.Background(), w)
if err != nil {
errors.NewErrInternal(e.New("Unable to render dashboard"), err).ServeHTTP(w, r)
@@ -29,8 +31,7 @@ templ (h Homepage) page() {
style="height:100%;display:flex;gap:2rem;"
>
<div style="display:flex;flex-direction:column;gap:1rem;width:15rem;">
@components.LoginTwitter()
@components.LoginMastodon()
@app.TWITTER_APP.LoginButton()
</div>
<fieldset>
<textarea