diff --git a/examples/signup.go b/examples/signup.go index cc2ab16..077b14c 100644 --- a/examples/signup.go +++ b/examples/signup.go @@ -2,6 +2,7 @@ package examples import ( "fmt" + "time" "github.com/authorizerdev/authorizer-go" ) @@ -13,9 +14,10 @@ func SignUpExample() { panic(err) } - res, err := c.SignUp(&authorizer.LoginInput{ - Email: "test@yopmail.com", - Password: "Abc@123", + res, err := c.SignUp(&authorizer.SignUpInput{ + Email: fmt.Sprintf("test.%d@yopmail.com", time.Now().Unix()), + Password: "Abc@123", + ConfirmPassword: "Abc@123", }) if err != nil { panic(err) diff --git a/singup.go b/signup.go similarity index 95% rename from singup.go rename to signup.go index 5fbd16b..8fa6944 100644 --- a/singup.go +++ b/signup.go @@ -28,7 +28,7 @@ type SignUpInput struct { // It performs signup mutation on authorizer instance. // It takes SignUpInput reference as parameter and returns AuthTokenResponse reference or error. // For implementation details check SignUpExample examples/signup.go -func (c *AuthorizerClient) SignUp(req *LoginInput) (*AuthTokenResponse, error) { +func (c *AuthorizerClient) SignUp(req *SignUpInput) (*AuthTokenResponse, error) { bytesData, err := c.ExecuteGraphQL(&GraphQLRequest{ Query: fmt.Sprintf(`mutation signup($data: SignUpInput!) { signup(params: $data) { %s }}`, AuthTokenResponseFragment), Variables: map[string]interface{}{ diff --git a/test/main.go b/test/main.go index b17c3f0..1f5850f 100644 --- a/test/main.go +++ b/test/main.go @@ -10,5 +10,6 @@ func main() { // examples.GetSessionExample() // examples.LogoutExample() // examples.MagicLinkLoginExample() - examples.ValidateJWTTokenExample() + // examples.ValidateJWTTokenExample() + examples.SignUpExample() }