Files
m3o-go/examples/user/login/logAUserIn/main.go
2021-11-03 15:36:34 +00:00

21 lines
439 B
Go
Executable File

package main
import (
"fmt"
"os"
"go.m3o.com/user"
)
// Login using username or email. The response will return a new session for successful login,
// 401 in the case of login failure and 500 for any other error
func main() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.Login(&user.LoginRequest{
Email: "joe@example.com",
Password: "mySecretPass123",
})
fmt.Println(rsp, err)
}