Compare commits
5 Commits
@blitzjs/g
...
working-to
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef38a4008a | ||
|
|
a9a3167a0f | ||
|
|
64c75087dc | ||
|
|
257b1e8b27 | ||
|
|
2fc9ceeed7 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -68,3 +68,4 @@ test/**/blitz-env.d.ts
|
||||
examples/**/blitz-env.d.ts
|
||||
.blitz**
|
||||
|
||||
*.sqlite
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { AuthClientPlugin } from "@blitzjs/auth"
|
||||
import { setupClient } from "@blitzjs/next"
|
||||
import { setupBlitzClient } from "@blitzjs/next"
|
||||
import { BlitzRpcPlugin } from "@blitzjs/rpc"
|
||||
|
||||
const { withBlitz } = setupClient({
|
||||
const { withBlitz } = setupBlitzClient({
|
||||
plugins: [
|
||||
AuthClientPlugin({
|
||||
cookiePrefix: "web-cookie-prefix",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { setupBlitz } from "@blitzjs/next"
|
||||
import { setupBlitzServer } from "@blitzjs/next"
|
||||
import { AuthServerPlugin, PrismaStorage } from "@blitzjs/auth"
|
||||
import { prisma as db } from "../db/index"
|
||||
import { simpleRolesIsAuthorized } from "@blitzjs/auth"
|
||||
|
||||
const { gSSP, gSP, api } = setupBlitz({
|
||||
const { gSSP, gSP, api } = setupBlitzServer({
|
||||
plugins: [
|
||||
AuthServerPlugin({
|
||||
cookiePrefix: "web-cookie-prefix",
|
||||
|
||||
47
apps/toolkit-app/db/migrations/20220426152136_/migration.sql
Normal file
47
apps/toolkit-app/db/migrations/20220426152136_/migration.sql
Normal file
@@ -0,0 +1,47 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "User" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
"name" TEXT,
|
||||
"email" TEXT NOT NULL,
|
||||
"hashedPassword" TEXT,
|
||||
"role" TEXT NOT NULL DEFAULT 'USER'
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Session" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
"expiresAt" DATETIME,
|
||||
"handle" TEXT NOT NULL,
|
||||
"hashedSessionToken" TEXT,
|
||||
"antiCSRFToken" TEXT,
|
||||
"publicData" TEXT,
|
||||
"privateData" TEXT,
|
||||
"userId" INTEGER,
|
||||
CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE SET NULL ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Token" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
"hashedToken" TEXT NOT NULL,
|
||||
"type" TEXT NOT NULL,
|
||||
"expiresAt" DATETIME NOT NULL,
|
||||
"sentTo" TEXT NOT NULL,
|
||||
"userId" INTEGER NOT NULL,
|
||||
CONSTRAINT "Token_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Session_handle_key" ON "Session"("handle");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Token_hashedToken_type_key" ON "Token"("hashedToken", "type");
|
||||
@@ -35,6 +35,7 @@
|
||||
"react": "18.0.0",
|
||||
"react-dom": "18.0.0",
|
||||
"react-hook-form": "7.29.0",
|
||||
"styled-jsx": "5.0.2",
|
||||
"ts-node": "10.7.0",
|
||||
"zod": "3.10.1"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {AuthClientPlugin} from "@blitzjs/auth"
|
||||
import {setupClient} from "@blitzjs/next"
|
||||
import {setupBlitzClient} from "@blitzjs/next"
|
||||
import {BlitzRpcPlugin} from "@blitzjs/rpc"
|
||||
|
||||
const {withBlitz} = setupClient({
|
||||
const {withBlitz} = setupBlitzClient({
|
||||
plugins: [
|
||||
AuthClientPlugin({
|
||||
cookiePrefix: "webapp-cookie-prefix",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {setupBlitz} from "@blitzjs/next"
|
||||
import {setupBlitzServer} from "@blitzjs/next"
|
||||
import {AuthServerPlugin, PrismaStorage} from "@blitzjs/auth"
|
||||
import {prisma as db} from "../prisma/index"
|
||||
import {simpleRolesIsAuthorized} from "@blitzjs/auth"
|
||||
|
||||
const {gSSP, gSP, api} = setupBlitz({
|
||||
const {gSSP, gSP, api} = setupBlitzServer({
|
||||
plugins: [
|
||||
AuthServerPlugin({
|
||||
cookiePrefix: "webapp-cookie-prefix",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {AuthClientPlugin} from "@blitzjs/auth"
|
||||
import {setupClient} from "@blitzjs/next"
|
||||
import {setupBlitzClient} from "@blitzjs/next"
|
||||
|
||||
const {withBlitz} = setupClient({
|
||||
const {withBlitz} = setupBlitzClient({
|
||||
plugins: [
|
||||
AuthClientPlugin({
|
||||
cookiePrefix: "auth-tests-cookie-prefix",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {setupBlitz} from "@blitzjs/next"
|
||||
import {setupBlitzServer} from "@blitzjs/next"
|
||||
import {AuthServerPlugin, PrismaStorage} from "@blitzjs/auth"
|
||||
import {simpleRolesIsAuthorized} from "@blitzjs/auth"
|
||||
import {prisma as db} from "../prisma/index"
|
||||
|
||||
const {gSSP, gSP, api} = setupBlitz({
|
||||
const {gSSP, gSP, api} = setupBlitzServer({
|
||||
plugins: [
|
||||
AuthServerPlugin({
|
||||
cookiePrefix: "auth-tests-cookie-prefix",
|
||||
|
||||
21
pnpm-lock.yaml
generated
21
pnpm-lock.yaml
generated
@@ -64,6 +64,7 @@ importers:
|
||||
react: 18.0.0
|
||||
react-dom: 18.0.0
|
||||
react-hook-form: 7.29.0
|
||||
styled-jsx: 5.0.2
|
||||
ts-node: 10.7.0
|
||||
typescript: ^4.5.3
|
||||
zod: 3.10.1
|
||||
@@ -80,6 +81,7 @@ importers:
|
||||
react: 18.0.0
|
||||
react-dom: 18.0.0_react@18.0.0
|
||||
react-hook-form: 7.29.0_react@18.0.0
|
||||
styled-jsx: 5.0.2_react@18.0.0
|
||||
ts-node: 10.7.0_2dcdb8fdc9a6e6d9aaf2aac9443a7c28
|
||||
zod: 3.10.1
|
||||
devDependencies:
|
||||
@@ -14090,6 +14092,25 @@ packages:
|
||||
dependencies:
|
||||
react: 18.0.0
|
||||
|
||||
/styled-jsx/5.0.2_react@18.0.0:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-LqPQrbBh3egD57NBcHET4qcgshPks+yblyhPlH2GY8oaDgKs8SK4C3dBh3oSJjgzJ3G5t1SYEZGHkP+QEpX9EQ==,
|
||||
}
|
||||
engines: {node: ">= 12.0.0"}
|
||||
peerDependencies:
|
||||
"@babel/core": "*"
|
||||
babel-plugin-macros: "*"
|
||||
react: ">= 16.8.0 || 17.x.x || ^18.0.0-0"
|
||||
peerDependenciesMeta:
|
||||
"@babel/core":
|
||||
optional: true
|
||||
babel-plugin-macros:
|
||||
optional: true
|
||||
dependencies:
|
||||
react: 18.0.0
|
||||
dev: false
|
||||
|
||||
/subarg/1.0.0:
|
||||
resolution: {integrity: sha1-9izxdYHplrSPyWVpn1TAauJouNI=}
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user