Skip to content

Commit

Permalink
fix: signup typo + signup input
Browse files Browse the repository at this point in the history
  • Loading branch information
lakhansamani committed Sep 27, 2022
1 parent 0b0209e commit ada5f84
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions examples/signup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package examples

import (
"fmt"
"time"

"github.com/authorizerdev/authorizer-go"
)
Expand All @@ -13,9 +14,10 @@ func SignUpExample() {
panic(err)
}

res, err := c.SignUp(&authorizer.LoginInput{
Email: "[email protected]",
Password: "Abc@123",
res, err := c.SignUp(&authorizer.SignUpInput{
Email: fmt.Sprintf("test.%[email protected]", time.Now().Unix()),
Password: "Abc@123",
ConfirmPassword: "Abc@123",
})
if err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion singup.go → signup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}{
Expand Down
3 changes: 2 additions & 1 deletion test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ func main() {
// examples.GetSessionExample()
// examples.LogoutExample()
// examples.MagicLinkLoginExample()
examples.ValidateJWTTokenExample()
// examples.ValidateJWTTokenExample()
examples.SignUpExample()
}

0 comments on commit ada5f84

Please sign in to comment.