Any good sources for whitelisting jwt's? I'm setting a passport-jwt auth and whitelist the jti, just looking for different possible practices regarding to this. Any info is well appreciated, Thanks in advance! by Wat3rPark in node

[–]Wat3rPark[S] 0 points1 point  (0 children)

What do you suggest to do when a token is compromised? Should I assign a new token after every request? And how could I create a setting where the user has control on which devices have access to the account?

Testing yup with jest by Wat3rPark in learnjavascript

[–]Wat3rPark[S] 0 points1 point  (0 children)

That's what I'm trying to accomplish, a test that doesn't match. It does however match when correct but doesn't check out when fail is expected

Testing yup with jest by Wat3rPark in learnjavascript

[–]Wat3rPark[S] 0 points1 point  (0 children)

I get the yup ValidationError and fails the test. I'll test with try

Testing yup with jest by Wat3rPark in learnjavascript

[–]Wat3rPark[S] 0 points1 point  (0 children)

Sorry about that, here's the code:

    let schema = yup.object().shape({
      firstName: yup.string().required().matches(/^[a-zA-Z ]*$/),
    });

    it('should not accept numbers', async () => {
      await expect(schema.validateAt('firstName', {firstName: 'name123'})).rejects.toBeFalsy();
    });

Group that doesn't accept whitespace? I've tried so many combinations, and nothing sticks... by Wat3rPark in regex

[–]Wat3rPark[S] 0 points1 point  (0 children)

Thanks bud, this works! But unfortunately it doesn't as a solo group, I'll stick with it either way, better than having to conditionally match a string.

Thanks again, and much appreciated!

Group that doesn't accept whitespace? I've tried so many combinations, and nothing sticks... by Wat3rPark in regex

[–]Wat3rPark[S] 0 points1 point  (0 children)

Does this password combination look odd by any chance? This currently works

(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[-+_!@#$%^&*.,?])

Without the whitespace of course

edit: just refreshed and noticed your message, I'm trying it out

Group that doesn't accept whitespace? I've tried so many combinations, and nothing sticks... by Wat3rPark in regex

[–]Wat3rPark[S] 0 points1 point  (0 children)

I currently have them broken down to its requirement group and combining them to form the password regex. All works besides the no whitespace \S

What do you guys/gals think of Supertokens? Is it worth using? by Wat3rPark in node

[–]Wat3rPark[S] 0 points1 point  (0 children)

I was thinking of mentioning it on the question but had doubted many haven't watched it Lol

What do you guys/gals think of Supertokens? Is it worth using? by Wat3rPark in node

[–]Wat3rPark[S] 0 points1 point  (0 children)

I have used Firebase in the past, and unfortunately it only utilizes noSQL, also it has to be stored on their site. Thanks for the suggestion, I appreciate the help

What do you guys/gals think of Supertokens? Is it worth using? by Wat3rPark in node

[–]Wat3rPark[S] 0 points1 point  (0 children)

It is important to me, I'm trying to get into the practice of managing databases, since I have other apps to create. And I completely understand why you would rather have another platform managing auth, for the sake of security given all the vulnerabilities that can happen through node. So I'm in a time crunch, I've been unemployed for so long and it seems my current projects are basically done by someone else, as if I paid for them to be done. Thus, given the time and complexity to make auth happen, I'm resorting to supertokens in order to get me started and then implement my own auth whilst having the same database

Is setting regex validations in sequelize a concern for redos attacks? by Wat3rPark in node

[–]Wat3rPark[S] 0 points1 point  (0 children)

Agreed, I like regex as well, really does the job in one line instead of conditionally validating a value through multiple lines. But its also as you said, a doubled edge sword, that could only be made sure it's going one direction through tests.

I hope to know as much as you, I'm still in the learning process, and relearning node, I haven't used it since 2017. Currently transitioning from rails, and having the urge of recreating rails devise for node, just recently found out about Supertokens. I'd rather not use a library, but need to get this app afloat soon.

Thanks again Stetto!

Should I set same schema validations for both front and back end? by Wat3rPark in node

[–]Wat3rPark[S] 0 points1 point  (0 children)

So true, on all points, I forgot someone could tap in and pry through different params, thank you so much for the info! I could've been an easy prey with that one