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); } }
func (a *AuthController) AppLoginUserHandler(c *gin.Context) { loginUser(c, db.NewAppUsersDbService(c.Param("appId"))) }
func (a *AuthController) AppRegisterUserHandler(c *gin.Context) { registerUser(c, db.NewAppUsersDbService(c.Param("appId"))) }