forgot password
This commit is contained in:
parent
d9855bb220
commit
0a9e4639f2
1
main.go
1
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)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
32
module/member/reset_password.go
Normal file
32
module/member/reset_password.go
Normal 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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user