forgot password

This commit is contained in:
geek 2017-08-30 15:48:04 +09:00
parent d9855bb220
commit 0a9e4639f2
3 changed files with 36 additions and 4 deletions

View File

@ -50,6 +50,7 @@ func main() {
s.Route("POST", "/account/signin", member.SignIn)
s.Route("POST", "/account/signup", member.SignUp)
s.Route("POST", "/account/forgot_password", member.ForgotPassword)
s.Route("POST", "/account/reset_password", member.ResetPassword)
s.Route("GET", "/account/check_email", member.CheckEmail)
fasthttp.ListenAndServe(":19080", s.Handler)

View File

@ -24,11 +24,10 @@ func ForgotPassword(sctx *server.ServerContext, ctx *fasthttp.RequestCtx) {
fmt.Fprintf(ctx, "avail: %d\n", grpcPool.Available())
signinId := string(ctx.FormValue("signinId"))
signinPw := string(ctx.FormValue("signinPw"))
params := []string{signinId, signinPw}
params := []string{signinId}
r, err := c.Exec("MemberService", "forgotPassword", params)
r, err := c.Exec("MemberService", "sendEmailForPassword", params)
fmt.Fprintf(ctx, "Password Change!!!!: %s\n", r)
fmt.Fprintf(ctx, "Confirm Email!!!!: %s\n", r)
}

View File

@ -0,0 +1,32 @@
package member
import (
"github.com/valyala/fasthttp"
"git.loafle.net/overflow/overflow_server_app/server"
"git.loafle.net/overflow/overflow_server_app/backend"
"fmt"
)
func ResetPassword(sctx *server.ServerContext, ctx *fasthttp.RequestCtx) {
//msg := sctx.Value("key1")
//
//fmt.Fprintf(ctx, "Welcome!!!!: %s \n", msg)
grpcPool := sctx.Value("grpc").(backend.Pool)
c, err := grpcPool.Get()
if nil != err {
}
defer c.Close()
fmt.Fprintf(ctx, "avail: %d\n", grpcPool.Available())
signinId := string(ctx.FormValue("signinId"))
signinPw := string(ctx.FormValue("signinPw"))
params := []string{signinId, signinPw}
r, err := c.Exec("MemberService", "resetPassword", params)
fmt.Fprintf(ctx, "Complete Reset Password!!!!: %s\n", r)
}