Fixed Typo
Cette révision appartient à :
Parent
1055744920
révision
773ce60848
4 fichiers modifiés avec 10 ajouts et 9 suppressions
|
@ -9,6 +9,9 @@ install:
|
||||||
- go get github.com/Sirupsen/logrus
|
- go get github.com/Sirupsen/logrus
|
||||||
- go get gopkg.in/natefinch/lumberjack.v2
|
- go get gopkg.in/natefinch/lumberjack.v2
|
||||||
- go get gopkg.in/gomail.v2
|
- go get gopkg.in/gomail.v2
|
||||||
|
- go get github.com/gorilla/securecookie
|
||||||
|
- go get golang.org/x/crypto/bcrypt
|
||||||
|
- go get github.com/nicksnyder/go-i18n/i18n
|
||||||
- go build
|
- go build
|
||||||
deploy:
|
deploy:
|
||||||
provider: releases
|
provider: releases
|
||||||
|
|
|
@ -11,8 +11,7 @@ import (
|
||||||
"github.com/ewhal/nyaa/db"
|
"github.com/ewhal/nyaa/db"
|
||||||
"github.com/ewhal/nyaa/model"
|
"github.com/ewhal/nyaa/model"
|
||||||
"github.com/ewhal/nyaa/util/log"
|
"github.com/ewhal/nyaa/util/log"
|
||||||
"github.com/ewhal/nyaa/util/validation"
|
"github.com/ewhal/nyaa/util/modelHelper"
|
||||||
"github.com//modelHelper"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var cookieHandler = securecookie.New(
|
var cookieHandler = securecookie.New(
|
||||||
|
@ -90,7 +89,7 @@ func SetCookieHandler(w http.ResponseWriter, email string, pass string) (int, er
|
||||||
if email != "" && pass != "" {
|
if email != "" && pass != "" {
|
||||||
log.Debugf("User email : %s , password : %s", email, pass)
|
log.Debugf("User email : %s , password : %s", email, pass)
|
||||||
var user model.User
|
var user model.User
|
||||||
isValidEmail := validation.EmailValidation(email)
|
isValidEmail := EmailValidation(email)
|
||||||
if isValidEmail {
|
if isValidEmail {
|
||||||
log.Debug("User entered valid email.")
|
log.Debug("User entered valid email.")
|
||||||
if db.ORM.Where("email = ?", email).First(&user).RecordNotFound() {
|
if db.ORM.Where("email = ?", email).First(&user).RecordNotFound() {
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
package userService
|
package userService
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ewha/nyaa/db"
|
"github.com/ewhalnyaa/db"
|
||||||
"github.com/ewha/nyaa/model"
|
"github.com/ewhal/nyaa/model"
|
||||||
// "github.com/gin-gonic/gin"
|
// "github.com/gin-gonic/gin"
|
||||||
"errors"
|
"errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/ewha/nyaa/util/log"
|
"github.com/ewhal/nyaa/util/log"
|
||||||
"github.com/ewha/nyaa/util/retrieveHelper"
|
|
||||||
// "github.com/dorajistyle/goyangi/util/crypto"
|
// "github.com/dorajistyle/goyangi/util/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"github.com/ewhal/nyaa/config"
|
"github.com/ewhal/nyaa/config"
|
||||||
"github.com/ewhal/nyaa/db"
|
"github.com/ewhal/nyaa/db"
|
||||||
"github.com/ewhal/nyaa/model"
|
"github.com/ewhal/nyaa/model"
|
||||||
"github.com/ewhal/nyaa/util/modelHandler"
|
"github.com/ewhal/nyaa/util/modelHelper"
|
||||||
"github.com/ewhal/nyaa/util/crypto"
|
"github.com/ewhal/nyaa/util/crypto"
|
||||||
"github.com/ewhal/nyaa/util/email"
|
"github.com/ewhal/nyaa/util/email"
|
||||||
"github.com/ewhal/nyaa/util/log"
|
"github.com/ewhal/nyaa/util/log"
|
||||||
|
@ -68,7 +68,7 @@ func SendVerification(r *http.Request) (int, error) {
|
||||||
func EmailVerification(w http.ResponseWriter, r *http.Request) (int, error) {
|
func EmailVerification(w http.ResponseWriter, r *http.Request) (int, error) {
|
||||||
var user model.User
|
var user model.User
|
||||||
var verifyEmailForm VerifyEmailForm
|
var verifyEmailForm VerifyEmailForm
|
||||||
modelHandler.BindValueForm(&verifyEmailForm, r)
|
modelHelper.BindValueForm(&verifyEmailForm, r)
|
||||||
log.Debugf("verifyEmailForm.ActivationToken : %s", verifyEmailForm.ActivationToken)
|
log.Debugf("verifyEmailForm.ActivationToken : %s", verifyEmailForm.ActivationToken)
|
||||||
if db.ORM.Where(&model.User{ActivationToken: verifyEmailForm.ActivationToken}).First(&user).RecordNotFound() {
|
if db.ORM.Where(&model.User{ActivationToken: verifyEmailForm.ActivationToken}).First(&user).RecordNotFound() {
|
||||||
return http.StatusNotFound, errors.New("User is not found.")
|
return http.StatusNotFound, errors.New("User is not found.")
|
||||||
|
|
Référencer dans un nouveau ticket