Use temporary redirects

This commit is contained in:
2019-06-03 15:06:57 +09:00
parent e11295019b
commit cf258573a8
12 changed files with 28 additions and 23 deletions

View File

@ -53,7 +53,7 @@ func InstallTwitterAuth(app *aero.Application) {
ctx.Session().Set("tempCred", tempCred)
url := config.AuthorizationURL(tempCred, nil)
return ctx.Redirect(http.StatusFound, url)
return ctx.Redirect(http.StatusTemporaryRedirect, url)
})
// This is the redirect URL that we specified in /auth/twitter.
@ -124,7 +124,7 @@ func InstallTwitterAuth(app *aero.Application) {
// Log
authLog.Info("Added Twitter ID to existing account | %s | %s | %s | %s | %s", user.Nick, user.ID, ctx.IP(), user.Email, user.RealName())
return ctx.Redirect(http.StatusFound, "/")
return ctx.Redirect(http.StatusTemporaryRedirect, "/")
}
var getErr error
@ -139,7 +139,7 @@ func InstallTwitterAuth(app *aero.Application) {
user.Save()
session.Set("userId", user.ID)
return ctx.Redirect(http.StatusFound, "/")
return ctx.Redirect(http.StatusTemporaryRedirect, "/")
}
// Try to find an existing user via the associated e-mail address
@ -156,7 +156,7 @@ func InstallTwitterAuth(app *aero.Application) {
user.Save()
session.Set("userId", user.ID)
return ctx.Redirect(http.StatusFound, "/")
return ctx.Redirect(http.StatusTemporaryRedirect, "/")
}
// Register new user
@ -191,6 +191,6 @@ func InstallTwitterAuth(app *aero.Application) {
authLog.Info("Registered new user via Twitter | %s | %s | %s | %s | %s", user.Nick, user.ID, ctx.IP(), user.Email, user.RealName())
// Redirect to starting page for new users
return ctx.Redirect(http.StatusFound, newUserStartRoute)
return ctx.Redirect(http.StatusTemporaryRedirect, newUserStartRoute)
})
}