« first day (3616 days earlier)      last day (1325 days later) » 

12:09 AM
Hey everyone! I just published an article about Firestore's security. Check it out and let me know your thoughts! Thanks! Why Firestore Encourages Bad Security!
 
yeeeaaaaaaa
 
hey is linking to all these other questions a bad idea? should I delete my comments?
-2
Q: Using fetch with Passport gets "No 'Access-Control-Allow-Origin' header is present on the requested resource."

AdamI am trying to put a button on my website which will let the user authorize access to his YouTube account. I am using Passport for the authentication. My code is using fetch to send the request. When I click on the button, I get: Access to fetch at 'https://accounts.google.com/o/oauth2/auth?acce...

 
thanks forrest <3
 
heck yeah
is that your first online article?
I need to do that myself
 
pretty much I'm getting smacked down a lot
 
12:16 AM
@forresthopkinsa yep, i have a draft of another one but never finished
 
@Adam Do you think your question is a duplicate?
@JBis nice!
 
It looks related but I don't know very much
maybe I should let other people find it and decide for themselves?
 
Well if you convince people that your question is a duplicate they'll probably downvote and then close it
 
ok
 
at least you're honest lol
 
12:17 AM
i want to learn
 
It's good that you can find the dups tho. Next time, try to find them before posting a question to avoid loss of rep.
 
Adam, you can't fetch another website's private API like that
 
I did read them but didn't really understand if they were the same, since when I tried what they suggested it didn't work
 
The reason linking the user to the website works is because that's how the site is meant to be used; the API isn't intended to be consumed by an unauthorized web app like that
 
what do you mean? I'm using Passport to access YouTube api they have a strategy for it
 
12:19 AM
I haven't used Passport
 
I don't understand
 
But I'll tell you that if you try fetching the Google accounts api from your frontend, it won't work
 
no Passport runs on the backend
 
Well your CORS error is coming from your frontend
 
as I understand it the only way to address the CORS error is on Google's server
or Passport is not accessing Google's API correctly
which would be a problem with Passport that I can't fix
 
12:21 AM
You can't fetch private APIs (including Google's accounts api) from your frontend
Your options are either to send your users to Google's page directly (oauth) or try to consume the API from your backend
 
Yes, I think it is the backend that is sending the request to Google, my frontend accesses a route on my backend's API which then uses Passport. I'm following a tutorial youtube.com/playlist?list=PL4cUxeGkcC9jdm7QX143aMLAqyM-jTZ2x
 
@Adam what exactly are you trying to do? OAuth with youtube via passport?
 
yes
it works if I do it from an href as mentioned in the open Passport issue I linked to
so that could be my workaround
 
Adam, the error you're posting in your question is from your frontend fetching the Google accounts api
 
yes but it works with an href, or Postman
 
12:26 AM
Right
 
because it's the browser checking for the header
 
i could be wrong, but isn't passport just for signing up with google, not for accessing the acount information?
 
passport does the authentication
 
||mdn same origin policy
 
oh is that the issue, I'm not supposed to ask for information about the user from my front end after the authentication?
 
12:27 AM
i think passport acts as a "Sign Up With" mechansim, not a "access this user's data via an API" mechanism
 
read this page
 
yes but why does it work from an href but not a fetch, is that supposed to happen?
 
I don't understand how I am supposed to sign up ... the link goes to my server, which then contacts google, which shows me the sign up form, which calls back to my server
I am following the tutorial
 
12:30 AM
but you don't want to sign up
> which will let the user authorize access to his YouTube account
 
oh that one
 
thats not what passport is for
 
my purpose is to write an app that lets you manage your youtube playlists so I need the ability to create them
 
exacltiy
 
I can fix that later after I get authenticated, if you have advice for how I can do that I would be happy to hear it
 
12:32 AM
read that, you don't want to use passport
 
I do have the ability right now to sign up and access YouTube and create playlists, just not with Passport
 
yeah because passport isnt meant for that
 
But since my app requires access to YouTube I don't want to track a local account, let Google do it all
also eventually I want to get access to Spotify
 
alright nvm ignore me, i think i am wrong
 
wow really?
but thank you for talking through it with me
 
12:34 AM
i haven't used passport, it seems like you can request permissions with their api
 
that is handled by the Google API with their "scope" parameter
 
12:58 AM
oh, right, I see now, the fetch in my frontend only goes to my backend, my frontend is not trying to fetch from Google
 
don't you hate when you are debugging something for 30 min and you realize you forgot to hit compile
 
1:28 AM
oh or when you wonder why the build/public server doesn't work.. Only to notice you forgot to push to production :P
 
1:44 AM
yepo
Yay! James SO client is working on the new version. Will finish it up in the next couple days and push.
 
 
5 hours later…
7:12 AM
Hi @all, I am using a multi select drop but its reset all selected options
 
@user1620882 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.
 
eslint keeps on telling me that it can't find the webpack path aliases in my webpack config. I can't get rid of the error
I don't understand eslint sometimes
 
0
Q: Reset all selected options in multiselect dropdown

user1620882I am using multiselect dropdown at multiple times. I want to reset all the selected buttons. I tried prop function and multiselect('refresh') but none worked for me Using script for multi select dropdown using : https://github.com/nobleclem/jQuery-MultiSelect $(function() { $('select[multip...

 
8:09 AM
@JBis Why don't you run it in a nodejs server environment?
 
@paul23 it is
 
8:32 AM
is it a bad idea to use all api though websocket (not just only notifications) ?
I cant find anything on it
any suggestions ?
 
Well you don't get the neat well-understood language of rest. That's about it, it means that future devs just have to look up a lot more and take longer to get acquainted.
 
its not a bad idea is it ?
i am really intersted to implement it in my project
 
 
1 hour later…
user13780186
9:56 AM
how to call the api from python > angular and display the data?
 
"the api"?
 
 
1 hour later…
11:02 AM
const arr = [1,2,3,4];

const arr2 = arr.map((a, b, c) => console.log(a + " | " + b + " | " + c));

// console.log(a): 1, 2, 3, 4
// console.log(b): 0, 1, 2, 3
// console.log(c): 1,2,3,4, 1,2,3,4, 1,2,3,4, 1,2,3,4
Trying to understand how the arguments in the arrow function are evaluated. The first argument (a) is set to the value of the array at a given index. (b) is then the index itself. But why does (c) print out the whole array for each index?
 
good question
maybe if you wanted to cross reference the array with itself
I dunno, I've never had to use it honestly
 
11:26 AM
|| mdn array map
 
@Strict ^
|| starspam
 
the star feature is not meant to be used as a "like" feature. Please respect it
 
12:25 PM
can you alias mdn to rtfm?
 
12:48 PM
@BenFortune lol, sure
 
I am beginer in Javascript and I have prepared code, where the output is undefined. How do I correct this. please advise
function testMove(x,y) {
    x = Math.abs(x);
    var Fx = factorial(x);
    y = Math.abs(y);
    var Fy = factorial(y);
function factorial(n) {
    if(n == 0 || n == 1) {
    return 1;
   } else {
 return n * factorial(n-1)};
}
var final = factorial(x+y)/(Fx*Fy);
console.log(final);
}
console.log(testMove(-2,2));
 
@Prashant please dont ping me
 
@JBis I removed... my apologies
 
1:33 PM
4 messages moved to Trash can
 
2:10 PM
@Prashant testMove doesn't actually return anything
 
@Neil would you suggest any changes for removing the undefined output
 
well, who am I to say that you should be returning something? If you want to receive undefined, don't add a return statement
 
@Neil console.log(final) is the correct output. Since I have defined input values in the console.log(testMove(-2,2)) I am getting undefined.. Is there any way to get the output changed from undefined to (final)
 
I told you twice already. You need to add a return statement
 
2:27 PM
@Neil thanks dear...
 
Sorry if I'm being blunt, but I don't like repeating myself.
 
@Neil thats ok, I have one query -- Is there any other method to avoid calling function factorial(n) within function testMove ?
 
yes, you can move the factorial function outside
there's no reason for it to be inside testMove
you'd normally have an inner function when it uses variables in the outer function
generally if you can avoid it, it is better, because it's more readable that way
 
okay, Let me try
@Neil It works... a big thank you
 
nod
 
3:26 PM
test
@JamesBot is running the new version. Until I get everything fixed he maybe a bit weird.
3
@KarelG this maybe a bit more difficult then i thought as it uses url hashes instead of unique urls
 
 
1 hour later…
5:02 PM
!!echo stahp
 
stahp
HAMMAHTIME!
 
stop
 
HAMMERTIME!
 
!!help
 
Command documentation and syntax can be found here.
 
 
1 hour later…
6:22 PM
posted on September 09, 2020 by Prudhvikumar Bommana

 The beta channel has been updated to 86.0.4240.30 for Mac, Windows and Linux platforms A full list of changes in this build is available in the log. Interested in switching release channels?  Find out how here. 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 common issues. Google Ch

 
@Feeds @{USERNAME} 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.
 
Hey guys,
This is a CSS related question -

I have a side nav bar having a title and some other info inside of it, title name is sticky, and the side panel is acquiring height of 100vh. I want my title div (`sticky-title`) to have box shadow only when the user scrolls down (when the context is greater than 100vh). In other words, box-shadow property initially should not be there, but it should come up when the user scrolls down the page.
Below is codesandbox playground link to the same.

https://codesandbox.io/s/blue-glitter-6ds36
 
@PushpendraYadav @{USERNAME} 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.
 
perfect
 
i think james isn't workin
!!tell
 
6:29 PM
Invalid command! Did you mean: tel, telll, help? Try help for a list of available commands.
 
!!afk
 
@KevinB bye Kevin B
@JamesBot KevinB is afk:
 
Lol
 
sigh
 
!!afk stop
 
6:31 PM
HAMMERTIME!
@KevinB bye Kevin B
 
@KevinB yo
 
i wonder if the !!afk stop canceled the other one
if not both of them
 
no idea, i'll check the code later, pushing and fix for welcome message now
|| rtfm array sort
 
Hey, read the JS Manual or JQ Manual.
 
|| unlearn rtfm
 
6:35 PM
You do not have permission to remove this command.
 
sigh
@BenFortune i tried
 
!!unlearn rtfm
 
You do not have permission to remove this command.
 
core command?
!!mdn js array
 
6:38 PM
yeah the issue is that the unlearn is reading from core commands and || rtfm is reading from learned commands idk why
 
 
2 hours later…
8:47 PM
@GeorgeTiganila 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.
 
Hi, quick question.
I want to sort an Array by a string property, but when I call the sort() I have an error in the console for the display() function. As it can't sort because forEach() inside display() returns undefined
 
got code? ( ͡• ͜ʖ ͡• )
 
it should sort by .purchased property
 
err
displayList()
displayList kinda needs an array to work with
 
Thank you!
 
9:45 PM
Hello :) I'm trying to rename a button in the review queues, but I can't seem to isolate it. When I do it in a text-html page, it's working fine. Like here But when I put all the console logging into a userscript surrounded by (function() { <all the logging> })(); I'm getting different results, meaning no button to change the text to. It seems there are no elements, despite that I have the same div and buttons inside.
..I'm a little disappointed that JamesBot didn't say hi to me :)
 
i bet it's a race condition of some kind
the elements get added some time in the future
might be some event you can listen for
or callback to hook into
 
I figured it probably would be. It least I wasn't going mad for nothing :D
 
setting a breakpoint somewhere early in their code then stepping through it might get you to the ajax call that does the work, then you can work backwards from there to see if the callback is accessible
 
Thanks :) I'll try to work it out. (I'm not a javascript developer, so I'll need to learn some stuff)
 
10:17 PM
nice thing about SE's codebase is most of the pages, such as reviews, have their own .js file with the important stuff specific to that page
so it's real easy to open it up and poke around
 
10:28 PM
When you say real easy.. ?!?.. some of us have no idea how to do that :)
But.. I cheated and looked at another user script. It worked putting it into $(document).ajaxComplete(function(event, xhr, settings) {...} :)
 
10:52 PM
 
@Feeds 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.
 
11:04 PM
lol!.. Feeds get a welcome? But I don't :D
Thanks for the help btw :) Much appreciated.
 
11:34 PM
posted on September 09, 2020 by Krishna Govind

 Hi everyone! We've just released Chrome Beta 86 (86.0.4240.30) for Android: it's now available on Google Play. You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here. If you find a new issue, please let us know by filing a bug. Krishna Govind Google C

 

« first day (3616 days earlier)      last day (1325 days later) »