create-prisma-php-app 1.11.17 → 1.11.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,6 @@ use DateTime;
9
9
  use Lib\Validator;
10
10
  use GuzzleHttp\Client;
11
11
  use GuzzleHttp\Exception\RequestException;
12
- use Lib\Prisma\Classes\Prisma;
13
12
 
14
13
  class Auth
15
14
  {
@@ -209,6 +208,11 @@ class Auth
209
208
  }
210
209
  }
211
210
 
211
+ private function saveAuthInfo($responseInfo, $accountData)
212
+ {
213
+ // Save user data to the database
214
+ }
215
+
212
216
  public function authProviders(GithubProvider | null $githubProvider = null, GoogleProvider | null $googleProvider = null)
213
217
  {
214
218
  global $isGet, $dynamicRouteParams;
@@ -297,32 +301,7 @@ class Auth
297
301
  'scope' => $tokenData->scope,
298
302
  ];
299
303
 
300
- $prisma = new Prisma();
301
- $foundUser = $prisma->user->findUnique([
302
- 'where' => [
303
- 'email' => $primaryEmail,
304
- ],
305
- ]);
306
-
307
- if (!$foundUser) {
308
- $userData = [
309
- 'name' => $responseInfo->login,
310
- 'email' => $primaryEmail,
311
- 'image' => $responseInfo->avatar_url,
312
- 'emailVerified' => $primaryEmail ? date("Y-m-d H:i:s") : null,
313
- 'Account' => [
314
- 'create' => $accountData,
315
- ]
316
- ];
317
-
318
- $createUser = $prisma->user->create([
319
- 'data' => $userData,
320
- ]);
321
-
322
- if (!$createUser) {
323
- exit("Error occurred. Please try again.");
324
- }
325
- }
304
+ $this->saveAuthInfo($responseInfo, $accountData);
326
305
 
327
306
  $userToAuthenticate = [
328
307
  'name' => $responseInfo->login,
@@ -380,32 +359,7 @@ class Auth
380
359
  'scope' => $tokenData->scope,
381
360
  ];
382
361
 
383
- $prisma = new Prisma();
384
- $foundUser = $prisma->user->findUnique([
385
- 'where' => [
386
- 'email' => $responseInfo->email,
387
- ],
388
- ]);
389
-
390
- if (!$foundUser) {
391
- $userData = [
392
- 'name' => $responseInfo->name,
393
- 'email' => $responseInfo->email,
394
- 'image' => $responseInfo->picture,
395
- 'emailVerified' => $responseInfo->email ? date("Y-m-d H:i:s") : null,
396
- 'Account' => [
397
- 'create' => $accountData,
398
- ]
399
- ];
400
-
401
- $createUser = $prisma->user->create([
402
- 'data' => $userData,
403
- ]);
404
-
405
- if (!$createUser) {
406
- exit("Error occurred. Please try again.");
407
- }
408
- }
362
+ $this->saveAuthInfo($responseInfo, $accountData);
409
363
 
410
364
  $userToAuthenticate = [
411
365
  'name' => $responseInfo->name,
@@ -29,7 +29,7 @@
29
29
  <p class="mx-auto max-w-[700px] text-gray-500 md:text-xl dark:text-gray-400">
30
30
  The Next Generation ORM for PHP
31
31
  </p>
32
- <a class="inline-flex h-10 items-center justify-center rounded-md bg-gray-900 px-8 text-sm font-medium text-gray-50 shadow transition-colors hover:bg-gray-900/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-950 disabled:pointer-events-none disabled:opacity-50 dark:bg-gray-50 dark:text-gray-900 dark:hover:bg-gray-50/90 dark:focus-visible:ring-gray-300" href="https://prismaphp.tsnc.tech/docs?doc=get-started">
32
+ <a class="inline-flex h-10 items-center justify-center rounded-md bg-gray-900 px-8 text-sm font-medium text-gray-50 shadow transition-colors hover:bg-gray-900/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-950 disabled:pointer-events-none disabled:opacity-50 dark:bg-gray-50 dark:text-gray-900 dark:hover:bg-gray-50/90 dark:focus-visible:ring-gray-300" href="https://prismaphp.tsnc.tech/docs?doc=get-started" target="_blank">
33
33
  Get Started
34
34
  </a>
35
35
  </div>
@@ -105,5 +105,7 @@
105
105
  /* Completeness */
106
106
  // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
107
107
  "skipLibCheck": true /* Skip type checking all .d.ts files. */
108
- }
108
+ },
109
+ "include": [],
110
+ "exclude": ["node_modules"]
109
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "1.11.17",
3
+ "version": "1.11.18",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",