« first day (3615 days earlier)      last day (1336 days later) » 

11:46 AM
Good morning everyone. I'm creating an app for a system I have. As the system is in php, all passwords were created using _password_hash_.

On the side of the app, which will be done in cordova, I am downloading all users to webSQL, to be able to access offline.

Is there a way to verify the password that was generated by php, but using JS, within the app?
 
No. PHP password functions refer to actual cryptographical algorithms. Those algorithms are purposely implemented the exact same way in multiple languages. You cannot tell the language. Why do you need to know that?
 
@JBis Since all users' passwords are generated by the php password_hash, I need to find out if there is a way to verify this password when logging into the app.
 
@Tiago Yes. You need to find the algo used. Check php docs.
 
12:29 PM
Are there any limitations to use something like json-server in production of a personal text-based-blog.
I know there are better alternatives just out of interest, if I store all the blog posts in a json file, would it ever become too big as to crash or cause data lossl
 
@relidon Could it theoretically become too big, yes, but it likely won't. The issue with JSON is you must read the entire file before you can get query it.
If you don't want to deal with database setups, you can use something like Sqlite or if you want NoSQL you can use Berkeley DB
 
12:42 PM
@JBis I've created a markdown based generator which I've been using for years, and knowing me, if it wasn't that I've built it to push to GitLab on every new entry, I would have lost work at least twice.

I have mongo installed in my system but the fact that I will forget to back it up scares me.

The json-server package seemed attractive that's why I asked. I've never used Sqlite I might give it a try
 
so you want your blog posts stored in version control?
You could dump the db every so often to json files and push it. I mean version control isn't supposed to be a data backup mechanism but if you don't really care, I think that would probably work.
 
1:02 PM
Is there a way that prettier/linter will use 4 spaces for JS code and 2 spaces for JSX in the same file?
I'm talking about VSCode
 
@JBis I'll look into this, thanks.
 
 
1 hour later…
2:20 PM
hmm is it possible to tell native libraries how to build?
sqlite uses native libraries, however I"m building at my home pc, and then pushing it into an alpine docker.
This brings a problem: when I build on ubuntu it binds against libc. However alpine doens't use libc, it uses musl as c library instead. Thus a lot of error occur when running.
 
dockerize the build process?
 
3:19 PM
hmm what would you guys recommend btw, starting using npm start or node app(server).js?
 
npm run start
 
it does create a child process in the docker though, so violates the best practice there.
 
3:34 PM
what does?
 
docker? It's quite strong paradigm of one process per docker
 
what is creating a child process? your app?
 
npm is
npm keeps running and spawns a child "node" process
 
I could be wrong but I thought it's supposed to be "one application" per container
many applications spawn child processes that you can't avoid. e.g. Apache.
 
yes but with npm it means the main process isn't the actual main process in the docker; so logging is done on the wrong process.
 
3:51 PM
I'm not sure how to solve that but there should be a way to have the node process log properly.
 
pains me that a question I am stuck at didn't get any further help :(
I've worked around the problem but it's not what I want
 
posted on September 08, 2020 by Richard Lau

Notable Changes [2ab33c58ae] - (SEMVER-MINOR) buffer: also alias BigUInt methods (Anna Henningsen) #34960 [44d89a9faa] - (SEMVER-MINOR) crypto: add randomInt function (Oli Lalonde) #34600 [8aac42caf2] - (SEMVER-MINOR) perf_hooks: add idleTime and event loop util (Trevor Norris) #34938 [4bb40078da] - (SEMVER-MINOR) stream: simpler and faster Readable async iterator (Robert Nagy) #34035 [ffae5f3

 
4:40 PM
!!choose stationeers spaceengineers
 
stationeers
 
This IS a css question and I apologize for posting it here but the css room is dead
Wondering if anyone has any ideas on how to rectify a display issue on a cool motorcycle site
Ill explain
If you goto any of my pages like so epicmotos.com/Motocross-blog.html you'll see an H1 for every section. Some of them look nice as the 1st one illustrates but I have too much empty space to the right of some H1's as can be seen by scrolling to the Readers Rides on Our Classifieds H1. Anyone got any great ideas about how to approach this dilemna?
 
5:00 PM
@Stuart headers are block elements by default and therefore have a default width of 100%. The only reason they are not all width 100% is because you limiting the width with max width. Use display: inline with a block container element (div) with padding and margin to space things.
also you usually only want one h1 per page, use h2 for subsections but that doesn't really matter
 
Hi,
 
@nibble Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
I am reading the getting-started section of node. According to the tutorial the value of process.env.NODE_ENV is set to development by default but i get undefined when i run console.log(process.env.NODE_ENV);. What am i missing here?
 
@JBis Thx... Somehow I forgot about my friend padding and using methods you suggested Doh!! Thx again
Hmm.. Rereading your suggestion might not work but you sat me up straight with "Padding" Thx again
 
5:28 PM
posted on September 08, 2020 by Srinivas Sista

 The stable channel has been updated to 85.0.4183.102 for Windows, Mac, and Linux, which will roll out over the coming days/weeks. A list of all changes is available in the log. Interested in switching release channels? Find out how. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about commo

 
why is bcrypt such a bitch?
 
what did you think the b stood for?
 
haha
xD
 
Alrightyyyyyy So Ive been working on making my motorcycle add a listing feature more attractive and now Im gonna ask as many as possible to take a look and lemme know what yall think. Would you (hypothetically) list a motorcycle here if you were selling one? If not, Why?
(Primary focus upon add a listing form)
Seeking tough love but not wild goose chases since I think its already as perfect as can get
People avoided it like a plague with a solid color bg, Now we'll see how the bg image changes peoples perpesctive
Me Personally? I think it was fine w a solid BG but I'll admit... I definetly like the BG image better
Input welcome
 
5:46 PM
Would it make sense to have certain fields that all listings should have? Mileage/hours for example?
 
was expecting a motorcycle game
      bcrypt.compare(plaintext,cryptedText).then(r=>console.log(r));
man.. in the node shell it gives me true
in the app its false
I don't get it
 
!!magic
 
(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。 ᵀᴴᴱ ᴳᴬᴹᴱ
 
{ username: 'gamer',
  password: '$2a$10$FS0a28ZQB0U4S3idsbR.6.RwZRWnl33GdL.P.S5962ZAr/S4WQQvq',
  email: 'gam@ar.ch',
  cover: 'motorcycleGame.jpg',
  createdAt: '2020-09-08T17:38:58.889Z',
  updatedAt: '2020-09-08T17:38:58.889Z',
  id: 10 }
this is whats in the DB
so..
 bcrypt.compare(user.password, db.password).then(r=>{
        console.log("LOOOGIN",r);  //nope its false!! WHAT?!
})
console.log(db.password); //$2a$10$/abqR1fJfNBzxx0bVtVOKOEZnosSXKsH98FnixReKyUyAnswvXtAq
 
and user.password?
 
6:00 PM
bcrypt.compare(user.password, "$2a$10$/abqR1fJfNBzxx0bVtVOKOEZnosSXKsH98FnixReKyUyAnswvXtAq").then(r=>{
console.log("LOOOGIN",r); // it is true.. WHAT???
})
user.passwor...aaah I see what you try!!!
hehe ehm its "test"
so when I put the hash string as string.. it is true
but when its in the variable db.password its false
so strange
do I need to do: toString(); ??
 
log the string before comparing it
and its type
 
Hashed_PW $2a$10$FS0a28ZQB0U4S3idsbR.6.RwZRWnl33GdL.P.S5962ZAr/S4WQQvq Plain_PW test
HashedPw Type string
LOOOGIN false
console.log("Hashed_PW",foundUser.password,"Plain_PW",user.password);
console.log("HashedPw_Type", typeof foundUser.password);

bcrypt.compare(user.password,foundUser.password.toString()).then(r=>{
            console.log("LOOOGIN",r);
});
 
why is there so much weird indentation going on here
what about typeof user.password
 
@Suisse Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
@forresthopkinsa I don't know what you mean <.<
 
6:06 PM
hm well I had been thinking maybe user.password was a different type but then I guess you wouldn't be pulling that value out of a database so that's unlikely
 
Hashed_PW $2a$10$FS0a28ZQB0U4S3idsbR.6.RwZRWnl33GdL.P.S5962ZAr/S4WQQvq Plain_PW test
HashedPw_Type string
PlainPw_Type string
LOOOGIN false
 
and if you log those on the server side they're all the same?
or on whatever side is working
 
@forresthopkinsa hmm no its a valid question.. since I pull out the user from db first just by user name (since unique), and in a second step I do the password encryption comparsion
@forresthopkinsa yes the logs are serverside logs.. strange
the only way it is working is, when I just write the long hash string directly as anonym string instead of foundUser.password
so strange
 
okay but in that scenario
if you log all the types and stuff
is it all the same
 
yes it is
 
6:14 PM
what ide are you using?
 
code
 
getting a feeling it's gonna be whitespace or something
can you just do a string comparison between your db hash and your string hash
 
> hash = '$2a$10$/abqR1fJfNBzxx0bVtVOKOEZnosSXKsH98FnixReKyUyAnswvXtAq'
'$2a$10$/abqR1fJfNBzxx0bVtVOKOEZnosSXKsH98FnixReKyUyAnswvXtAq'
> bcrypt.compare('test', hash).then(x=>console.log(x));
> true
^ this I did on the terminal in node
 
oh
so you're not in the same environment in these situations
 
no no before I did it in the code!
 
6:17 PM
can you add break points on the bcrypt line in node?
 
ufff debuging in node? never done this
Ok I just hit the debug button in code
and set a breakpoint
 
once it's hit, you can hover over the different var's to get their values
 
error: Sending 500 ("Server Error") response:
 Error: The module '/Users/jaha/project/zhawtool/node_modules/bcrypt/lib/binding/bcrypt_lib.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1003:18)
    at Module.load (internal/modules/cjs/loader.js:812:32)
 
that's unrelated, try recompiling, may need to alter code settings.
 
User.findOne({username: user.username}).exec(function (err, foundUser){
      console.log("FOUND FOUND",foundUser);
      if (err) {
        return res.serverError(err);
      }
so there is an error - thats why 500
when I try to debug
 
6:23 PM
the error you posted is unreleated. bcrypt is native so you need to recompile for proper node version.
 
ok but why I did not get this error when I just npm start?
 
can someone give me a clue why this question was downvoted and how to avoid it stackoverflow.com/questions/63783831/…
 
@Adam Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
it means the debugger is running a different version
I need to run to the grocery - they close soon

hmm this bcrypt is is ... aaaaaaargh!!!
 
@Adam that's... a relatively common problem
https://accounts.google.com/o/oauth2/auth isn't your server
cors middleware on your server won't cause it to send cors headers
 
6:28 PM
I understand that now
 
Kevin, you assume he doesn't work for Google
 
yes, yes i do
 
I did see this answer
553
Q: No 'Access-Control-Allow-Origin' header is present on the requested resource—when trying to get data from a REST API

daniel.lozynskiI'm trying to fetch some data from the REST API of HP Alm. It works pretty well with a small curl script - I get my data. Now doing that with JavaScript, fetch and ES6 (more or less) seems to be a bigger issue. I keep getting this error message: Fetch API cannot load . Response to preflight ...

but I didn't understand it
 
so, in this case, your problem is most likely you're using the api incorrectly
 
Yes, I think I will just use the link
 
6:30 PM
i haven't messed with google oauth in a while, or any oauth really
 
the answer i linked to talks about using a proxy
 
Proxying to Google? this smells phishy
What is your use case for doing that
 
yeah no proxy wouldn't be an option here
 
the person who posted that answer has over 50,000 reputation
 
Do you have a guide you are following for google oauth?
 
6:31 PM
of course I would like to know the best way
I am using Passport
 
that works
 
The person who posted that answer is not proxying to Google accounts api
 
can I configure Passport to take care of this
 
6:53 PM
posted on September 08, 2020 by Michael Dawson

Summary The Node.js project will release new versions of all supported release lines on or shortly after Tuesday, September 15, 2020. These releases will fix One critical severity issue One high severity issue One medium severity issue Impact The 14.x release line of Node.js is vulnerable to one critical severity issue, one high severity issue and one medium severity issue. The 12.x release

 
7:33 PM
one of my answers was deleted, how can I find out why
 
do you have a link to the question?
 
0
Q: Error when Authenticating with social provider from back-end

C00kieMonstaI'm having an error on my front-end when trying to authenticate with Auth0 login. My back-end should be able to authorize users using social providers (i.e. Auth0 or Google) and authenticate them using JSON Web Tokens (JWTs). I created all the back-end using passportJS and added a Auth0 passport...

I think what happened is, I found multiple questions with the same answer, so i tried to post identical answers to both of them
So I will wait until I get enough reputation to comment and post that
 
That is most likely correct
it was deleted by a moderator
duplicates should be closed as duplicates, not have answers copied around
 
ok thx
 
posted on September 08, 2020 by Ben Mason

Hi, everyone! We've just released Chrome 85 (85.0.4183.101) for Android: it'll become available on Google Play over the next few weeks. This release includes stability and performance improvements. You can see a full list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Ben Mason Google Chrome

 
 
3 hours later…
user13801785
10:26 PM
I have a question but it was not received well in the main Stack Overflow question and answer section. Please help me if you can. Title: I want to learn to write algorithms that will help me recommend different stuff to different people online.
 
@WiseEye Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
user13801785
I want my site recommended videos to my visitors based on what they have watched before, what they have liked, what they have spent more time on, their demographic, their location, the date the video was created, and many many other things. If I am making a website, my question is, how can I learn how to write this algorithm. Are there any online classes anyone can recommend me? What is the word of the thing I’m looking for? If this is for a website, do I write the code on JavaScript?
 
user13801785
 
@WiseEye thats not how stackoverflow works
stackoverflow is not for asking for reasources
 
10:50 PM
Good evening everyone. How can I use this library in a browser?
I'm using this file as a test: github.com/dcodeIO/bcrypt.js/tree/master/dist
 

« first day (3615 days earlier)      last day (1336 days later) »