Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0
Cette révision appartient à :
akuma06 2017-05-06 21:37:10 +02:00
Parent 1055744920
révision 773ce60848
4 fichiers modifiés avec 10 ajouts et 9 suppressions

Voir le fichier

@ -9,6 +9,9 @@ install:
- go get github.com/Sirupsen/logrus
- go get gopkg.in/natefinch/lumberjack.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
deploy:
provider: releases

Voir le fichier

@ -11,8 +11,7 @@ import (
"github.com/ewhal/nyaa/db"
"github.com/ewhal/nyaa/model"
"github.com/ewhal/nyaa/util/log"
"github.com/ewhal/nyaa/util/validation"
"github.com//modelHelper"
"github.com/ewhal/nyaa/util/modelHelper"
)
var cookieHandler = securecookie.New(
@ -90,7 +89,7 @@ func SetCookieHandler(w http.ResponseWriter, email string, pass string) (int, er
if email != "" && pass != "" {
log.Debugf("User email : %s , password : %s", email, pass)
var user model.User
isValidEmail := validation.EmailValidation(email)
isValidEmail := EmailValidation(email)
if isValidEmail {
log.Debug("User entered valid email.")
if db.ORM.Where("email = ?", email).First(&user).RecordNotFound() {

Voir le fichier

@ -1,14 +1,13 @@
package userService
import (
"github.com/ewha/nyaa/db"
"github.com/ewha/nyaa/model"
"github.com/ewhalnyaa/db"
"github.com/ewhal/nyaa/model"
// "github.com/gin-gonic/gin"
"errors"
"net/http"
"github.com/ewha/nyaa/util/log"
"github.com/ewha/nyaa/util/retrieveHelper"
"github.com/ewhal/nyaa/util/log"
// "github.com/dorajistyle/goyangi/util/crypto"
)

Voir le fichier

@ -8,7 +8,7 @@ import (
"github.com/ewhal/nyaa/config"
"github.com/ewhal/nyaa/db"
"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/email"
"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) {
var user model.User
var verifyEmailForm VerifyEmailForm
modelHandler.BindValueForm(&verifyEmailForm, r)
modelHelper.BindValueForm(&verifyEmailForm, r)
log.Debugf("verifyEmailForm.ActivationToken : %s", verifyEmailForm.ActivationToken)
if db.ORM.Where(&model.User{ActivationToken: verifyEmailForm.ActivationToken}).First(&user).RecordNotFound() {
return http.StatusNotFound, errors.New("User is not found.")