diff --git a/main.go b/main.go index db00ba2..59908c4 100644 --- a/main.go +++ b/main.go @@ -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) diff --git a/module/member/forgot_password.go b/module/member/forgot_password.go index a613bc4..6339cc2 100644 --- a/module/member/forgot_password.go +++ b/module/member/forgot_password.go @@ -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) } diff --git a/module/member/reset_password.go b/module/member/reset_password.go new file mode 100644 index 0000000..2d3b289 --- /dev/null +++ b/module/member/reset_password.go @@ -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) +} \ No newline at end of file