Skip to content

Commit cdeb63d

Browse files
committed
add bcrypt to compare passwords
1 parent 585ac48 commit cdeb63d

File tree

4 files changed

+415
-0
lines changed

4 files changed

+415
-0
lines changed

generated-schema.graphql

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,6 +2214,7 @@ type Player {
22142214
_count: PlayerCount
22152215
id: Int!
22162216
name: String!
2217+
password: String!
22172218
player_card(cursor: Player_cardWhereUniqueInput, distinct: [Player_cardScalarFieldEnum!], orderBy: [Player_cardOrderByWithRelationInput!], skip: Int, take: Int, where: Player_cardWhereInput): [Player_card!]!
22182219
}
22192220

@@ -2233,21 +2234,25 @@ type PlayerCountAggregate {
22332234
_all: Int!
22342235
id: Int!
22352236
name: Int!
2237+
password: Int!
22362238
}
22372239

22382240
input PlayerCountOrderByAggregateInput {
22392241
id: SortOrder
22402242
name: SortOrder
2243+
password: SortOrder
22412244
}
22422245

22432246
input PlayerCreateInput {
22442247
name: String!
2248+
password: String!
22452249
player_card: Player_cardCreateNestedManyWithoutPlayerInput
22462250
}
22472251

22482252
input PlayerCreateManyInput {
22492253
id: Int
22502254
name: String!
2255+
password: String!
22512256
}
22522257

22532258
input PlayerCreateNestedOneWithoutPlayer_cardInput {
@@ -2263,6 +2268,7 @@ input PlayerCreateOrConnectWithoutPlayer_cardInput {
22632268

22642269
input PlayerCreateWithoutPlayer_cardInput {
22652270
name: String!
2271+
password: String!
22662272
}
22672273

22682274
type PlayerGroupBy {
@@ -2273,26 +2279,31 @@ type PlayerGroupBy {
22732279
_sum: PlayerSumAggregate
22742280
id: Int!
22752281
name: String!
2282+
password: String!
22762283
}
22772284

22782285
type PlayerMaxAggregate {
22792286
id: Int
22802287
name: String
2288+
password: String
22812289
}
22822290

22832291
input PlayerMaxOrderByAggregateInput {
22842292
id: SortOrder
22852293
name: SortOrder
2294+
password: SortOrder
22862295
}
22872296

22882297
type PlayerMinAggregate {
22892298
id: Int
22902299
name: String
2300+
password: String
22912301
}
22922302

22932303
input PlayerMinOrderByAggregateInput {
22942304
id: SortOrder
22952305
name: SortOrder
2306+
password: SortOrder
22962307
}
22972308

22982309
input PlayerOrderByWithAggregationInput {
@@ -2303,11 +2314,13 @@ input PlayerOrderByWithAggregationInput {
23032314
_sum: PlayerSumOrderByAggregateInput
23042315
id: SortOrder
23052316
name: SortOrder
2317+
password: SortOrder
23062318
}
23072319

23082320
input PlayerOrderByWithRelationInput {
23092321
id: SortOrder
23102322
name: SortOrder
2323+
password: SortOrder
23112324
player_card: Player_cardOrderByRelationAggregateInput
23122325
}
23132326

@@ -2319,6 +2332,7 @@ input PlayerRelationFilter {
23192332
enum PlayerScalarFieldEnum {
23202333
id
23212334
name
2335+
password
23222336
}
23232337

23242338
input PlayerScalarWhereWithAggregatesInput {
@@ -2327,6 +2341,7 @@ input PlayerScalarWhereWithAggregatesInput {
23272341
OR: [PlayerScalarWhereWithAggregatesInput!]
23282342
id: IntWithAggregatesFilter
23292343
name: StringWithAggregatesFilter
2344+
password: StringWithAggregatesFilter
23302345
}
23312346

23322347
type PlayerSumAggregate {
@@ -2339,11 +2354,13 @@ input PlayerSumOrderByAggregateInput {
23392354

23402355
input PlayerUpdateInput {
23412356
name: StringFieldUpdateOperationsInput
2357+
password: StringFieldUpdateOperationsInput
23422358
player_card: Player_cardUpdateManyWithoutPlayerNestedInput
23432359
}
23442360

23452361
input PlayerUpdateManyMutationInput {
23462362
name: StringFieldUpdateOperationsInput
2363+
password: StringFieldUpdateOperationsInput
23472364
}
23482365

23492366
input PlayerUpdateOneRequiredWithoutPlayer_cardNestedInput {
@@ -2356,6 +2373,7 @@ input PlayerUpdateOneRequiredWithoutPlayer_cardNestedInput {
23562373

23572374
input PlayerUpdateWithoutPlayer_cardInput {
23582375
name: StringFieldUpdateOperationsInput
2376+
password: StringFieldUpdateOperationsInput
23592377
}
23602378

23612379
input PlayerUpsertWithoutPlayer_cardInput {
@@ -2369,6 +2387,7 @@ input PlayerWhereInput {
23692387
OR: [PlayerWhereInput!]
23702388
id: IntFilter
23712389
name: StringFilter
2390+
password: StringFilter
23722391
player_card: Player_cardListRelationFilter
23732392
}
23742393

index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ApolloServer } from "apollo-server";
44
import path from "path";
55
import { PrismaClient } from "@prisma/client";
66
import { resolvers } from "./prisma/generated/type-graphql";
7+
import bcrypt from "bcrypt";
78
import {
89
ApolloServerPluginLandingPageLocalDefault,
910
ApolloServerPluginLandingPageProductionDefault
@@ -55,6 +56,9 @@ async function main() {
5556
process.env.NODE_ENV === "production" ? ApolloServerPluginLandingPageProductionDefault({ footer: false }): ApolloServerPluginLandingPageLocalDefault({ footer: false, embed: true }),
5657
],
5758
});
59+
60+
const hashedpassword = bcrypt.hashSync('password', 8);
61+
console.log(hashedpassword);
5862

5963
server.listen(4000).then(({ url }) => {
6064
console.log(`🚀 Server ready at ${url}`);

0 commit comments

Comments
 (0)