Deleted utils.GetUser

This commit is contained in:
2019-11-17 16:59:34 +09:00
parent ad9870b1c1
commit daed4146ed
117 changed files with 178 additions and 271 deletions

View File

@ -11,7 +11,6 @@ import (
"github.com/aerogo/log"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/assets"
"github.com/animenotifier/notify.moe/utils"
jsoniter "github.com/json-iterator/go"
"golang.org/x/oauth2"
"golang.org/x/oauth2/facebook"
@ -100,7 +99,7 @@ func Facebook(app *aero.Application, authLog *log.Log) {
fbUser.Email = strings.Replace(fbUser.Email, "googlemail.com", "gmail.com", 1)
// Is this an existing user connecting another social account?
user := utils.GetUser(ctx)
user := arn.GetUserFromContext(ctx)
if user != nil {
// Add FacebookToUser reference

View File

@ -11,7 +11,6 @@ import (
"github.com/aerogo/log"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/assets"
"github.com/animenotifier/notify.moe/utils"
jsoniter "github.com/json-iterator/go"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
@ -111,7 +110,7 @@ func Google(app *aero.Application, authLog *log.Log) {
googleUser.Email = strings.Replace(googleUser.Email, "googlemail.com", "gmail.com", 1)
// Is this an existing user connecting another social account?
user := utils.GetUser(ctx)
user := arn.GetUserFromContext(ctx)
if user != nil {
// Add GoogleToUser reference

View File

@ -5,7 +5,7 @@ import (
"github.com/aerogo/aero"
"github.com/aerogo/log"
"github.com/animenotifier/notify.moe/utils"
"github.com/animenotifier/notify.moe/arn"
)
// Logout is called when the user clicks the logout button.
@ -13,7 +13,7 @@ import (
func Logout(app *aero.Application, authLog *log.Log) {
app.Get("/logout", func(ctx aero.Context) error {
if ctx.HasSession() {
user := utils.GetUser(ctx)
user := arn.GetUserFromContext(ctx)
if user != nil {
authLog.Info("%s logged out | %s | %s | %s | %s", user.Nick, user.ID, ctx.IP(), user.Email, user.RealName())

View File

@ -12,7 +12,6 @@ import (
"github.com/aerogo/log"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/assets"
"github.com/animenotifier/notify.moe/utils"
"github.com/gomodule/oauth1/oauth"
jsoniter "github.com/json-iterator/go"
)
@ -112,7 +111,7 @@ func Twitter(app *aero.Application, authLog *log.Log) {
twUser.Email = strings.Replace(twUser.Email, "googlemail.com", "gmail.com", 1)
// Is this an existing user connecting another social account?
user := utils.GetUser(ctx)
user := arn.GetUserFromContext(ctx)
if user != nil {
// Add TwitterToUser reference