示例#1
0
func TestAppRegisterUser(t *testing.T) {
	app := createApp(t)
	b := JSON{
		"email": randomString() + "@gmail.com",
		"password": "******",
	}

	r := sendAuthenticatedRequest("POST", "/app/" + app.Id + "/register", b, t)
	r.CodeIs(200)

	res, err := db.NewAppUsersDbService(app.Id).FindId(b["email"], nil)

	if res == nil || err != nil {
		t.Fatal("User not created correctly", res, err);
	}
}
示例#2
0
func (a *AuthController) AppLoginUserHandler(c *gin.Context) {
	loginUser(c, db.NewAppUsersDbService(c.Param("appId")))
}
示例#3
0
func (a *AuthController) AppRegisterUserHandler(c *gin.Context) {
	registerUser(c, db.NewAppUsersDbService(c.Param("appId")))
}