Forgot Password TypeGraphQL

  Рет қаралды 9,287

Ben Awad

Ben Awad

Күн бұрын

Пікірлер: 30
@MaRcOWinchester
@MaRcOWinchester 5 жыл бұрын
Thanks for the video, Ben! Really enjoying the series! I was testing the project until this video and seems like that Min validator is specific for numbers so I had to replace Min by Length. Thanks again!
@bawad
@bawad 5 жыл бұрын
thanks
@ryosupercell4137
@ryosupercell4137 5 жыл бұрын
change Min(5) to MinLength(5)
@bawad
@bawad 5 жыл бұрын
@Min is only for numbers, use @MinLength instead github.com/benawad/type-graphql-series/blob/9d6c1deb0ed484e544e4d64cb0467530aa50fb7e/src/modules/shared/PasswordInput.ts#L7
@prerakhere
@prerakhere 5 жыл бұрын
Every video of yours starts with "we're be going over" ;)
@bawad
@bawad 5 жыл бұрын
sounds accurate 😄
@sinamaleki3908
@sinamaleki3908 4 жыл бұрын
for PasswordInput validation is good to use @MinLength() method instead of Min() @InputType() export class PasswordInput { @Field() @MinLength(8) password: string; }
@peter_babic
@peter_babic 5 жыл бұрын
I believe @Min() is used for comparing numbers, not string length
@sinamaleki3908
@sinamaleki3908 4 жыл бұрын
use @MinLength(8)
@peterm.souzajr.2112
@peterm.souzajr.2112 5 жыл бұрын
prefix also needed on line 18 at time 13:01 . i look forward to all the rest of your videos!
@richarddoust6710
@richarddoust6710 4 жыл бұрын
In the 9th video in the series I had trouble because I added the Min validator to password as seen at 16:15 into this video. I think it should actually be MinLength. The test in video 9 fails if you do Min.
@jeromesnail
@jeromesnail 4 жыл бұрын
I'm late to the party but I'm well decided to make a real backend with postgres/graphql/typescript. A question regarding constants: couldn't they be typescript enums?
@bengr
@bengr 5 жыл бұрын
What if you wanted to extract multiple fields into their own input classes? You can't extend multiple classes (in TS).
@bawad
@bawad 5 жыл бұрын
you can get around that with mixins: const MyMixin = (BaseClass: T) => { @InputType() class SomeInput extends BaseClass { @Field() idk: string; } return SomeInput; }; @InputType() export class RegisterInput extends MyMixin(PasswordInput) { }
@keepforever726
@keepforever726 5 жыл бұрын
When you set up the glob statment with __dirname, wouldn't that also hit files that are not resolvers, for example, redisPrefixes would also fit that glob, no? Does it know that it's not a reslover somehow?
@bawad
@bawad 5 жыл бұрын
yeah it would, I think type-graphql just takes the classes with @Resolver decorator on it
@acehzo
@acehzo 5 жыл бұрын
Hi Ben .... fantastic as always! I ran into an issue using the resolvers import using the modules folder.... looks like the "ChangePasswordInput" input type gets imported more than once in the schema. Anyone else face this issue?
@bawad
@bawad 5 жыл бұрын
does it cause some kind of error?
@acehzo
@acehzo 5 жыл бұрын
@@bawad Yes, the following error: UnhandledPromiseRejectionWarning: Error: Schema must contain unique named types but contains multiple types named "ChangePasswordInput". I am graphql -> 14.1.1, apollo-server-express 2.4.8. I have also noticed in the latest version, the formatArgumentValidationError has been removed... No big issue with the above, i simply sticked to the initial method.... Wanted to say again, thank you very much for your videos! I really enjoy your approach and detailed topics!
@acehzo
@acehzo 5 жыл бұрын
@@Narlynarz Hi, yes, everything worked up to this point... Queries, Mutations, etc.... it only caused an issue when loading the resolvers from the folders. Not to worry though, i see later in the testing section Ben moves back to defining the specific resolvers....
@jeromesnail
@jeromesnail 4 жыл бұрын
Can we extends typeorm entities too? If all or at least some my entities have shared fields.
@yoyo26-34
@yoyo26-34 5 жыл бұрын
very good as usual
@sushilbansalk
@sushilbansalk 5 жыл бұрын
Hi Ben, is there a better way to handle errors and display those to users?
@bawad
@bawad 5 жыл бұрын
sometimes I just return the error through graphql
@tabziz
@tabziz 5 жыл бұрын
great video
@justind6983
@justind6983 4 жыл бұрын
I dont understand the need for a prefix. Could someone link an article or give a simple explanation why this matters? The tokens are not identical so reuse won't happen, unless I am misunderstanding something(probable)
@bawad
@bawad 4 жыл бұрын
If I want to lookup all keys for a specific thing I can look for the prefix
@justind6983
@justind6983 4 жыл бұрын
@@bawad thanks!
@sungwoncho3994
@sungwoncho3994 5 жыл бұрын
Great video, Ben! I see that now we have two places (register and changePassword) where we encrypt the password from user input using bcrypt. The other day I was reading the typeorm documentation and found entity listeners(typeorm.io/#/listeners-and-subscribers). They are like Sequelize hooks and I thought these may help you refactor the encryption code. Let me know what you think of them.
@bawad
@bawad 5 жыл бұрын
Yeah I think that would make for a nice refactoring
Login TypeGraphQL
16:33
Ben Awad
Рет қаралды 21 М.
Forgot and Reset Password with React + Node JS
28:13
Koding 101
Рет қаралды 51 М.
When u fight over the armrest
00:41
Adam W
Рет қаралды 25 МЛН
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 8 МЛН
Setting up a Test Environment TypeGraphQL
18:11
Ben Awad
Рет қаралды 12 М.
Confirmation Email TypeGraphQL
18:44
Ben Awad
Рет қаралды 12 М.
The Quest To Make Unbreakable Glass
22:23
Veritasium
Рет қаралды 119 М.
Guide to the GraphQL Ecosystem
19:47
Ben Awad
Рет қаралды 60 М.
The Value of Source Code
17:46
Philomatics
Рет қаралды 199 М.
No Black Box Machine Learning Course - Learn Without Libraries
3:51:31
freeCodeCamp.org
Рет қаралды 1,7 МЛН
GraphQL Basic Types
19:07
Ben Awad
Рет қаралды 29 М.
🚀  TDD, Where Did It All Go Wrong (Ian Cooper)
1:03:55
DevTernity Conference
Рет қаралды 566 М.
Register Resolver TypeGraphQL
18:05
Ben Awad
Рет қаралды 35 М.
When u fight over the armrest
00:41
Adam W
Рет қаралды 25 МЛН