refactor: change /api/oauth/twitter to /api/twitter/oauth
This commit is contained in:
@@ -14,10 +14,10 @@ var ROUTES = []Route{
|
||||
Handler: IndexHandler,
|
||||
},
|
||||
{
|
||||
Pattern: "/api/oauth/twitter",
|
||||
Pattern: "/api/twitter/oauth",
|
||||
Static: false,
|
||||
Page: TwitterLogin(),
|
||||
Handler: TwitterLoginHandler,
|
||||
Page: TwitterOAuth(),
|
||||
Handler: TwitterOAuthHandler,
|
||||
},
|
||||
{
|
||||
Pattern: "/robots.txt",
|
||||
|
||||
@@ -18,7 +18,7 @@ type TwitterTokenResponse struct {
|
||||
Scope string `json:"scope"`
|
||||
}
|
||||
|
||||
func TwitterLoginHandler(w http.ResponseWriter, r *http.Request) {
|
||||
func TwitterOAuthHandler(w http.ResponseWriter, r *http.Request) {
|
||||
error := internals.HttpErrorHelper(w)
|
||||
|
||||
code := r.URL.Query().Get("code")
|
||||
@@ -69,10 +69,10 @@ func TwitterLoginHandler(w http.ResponseWriter, r *http.Request) {
|
||||
c.Value = res.Token
|
||||
http.SetCookie(w, c)
|
||||
|
||||
TwitterLogin().Render(context.Background(), w)
|
||||
TwitterOAuth().Render(context.Background(), w)
|
||||
}
|
||||
|
||||
templ TwitterLogin() {
|
||||
templ TwitterOAuth() {
|
||||
@layouts.Page("Project Extrovert") {
|
||||
<dialog open>
|
||||
<article>
|
||||
Reference in New Issue
Block a user