any idea of why I have this bug ? just after the r...
# support-questions-legacy
l
any idea of why I have this bug ? just after the return below (getProfileInfo context), Back-End
Copy code
if (email === undefined || email === null) {
                            return {
                                id: id
                            };
                        } else {
                            return {
                                id: id,
                                email: {
                                    id: email,
                                    isVerified: isVerified
                                }
                            };
                        }
with Discord OAuth and I've the right id and email
r
Hey @Lucky (Jonathan)
l
Hey sir 🙂
r
Have you called supertokens.init?
l
OHHHH
HAHA
no
xD
oh wait, I do this
this.initDiscordProvider(); SuperTokens.init({...
& the initDiscordProvider init my discordProvider Variable
so I can't really use a variable and put it in the SuperTokens.init call ?
r
It’s hard for me to know what exactly is going wrong. But you need to make sure to initialise supertokens before it’s used.
You can use a variable. Yea
But you can’t call any of the supertokens functions before initialising it
l
code is in Nest.JS & the big function is below
r
I’ll have a look at the code snippet sometime tomorrow
But until then, try and figure it out - it’s probably a trivial error anyway
l
yea, I'm doing it without variable first to know if it's good
r
The error seems to be happening when creating a new session
If that’s a hint
One thing to keep in mind is that in NextJS APIs, you have to call supertokens init in all the APIs - in case you aren’t doing that
l
(It's Nest.js sir, the back-end side ^^, just to be sure) and I created the discordProvider inside the
Copy code
SuperTokens.init({
, same mmh
Google works properly thought ^^
r
Ah right.
Try it without a variable and see
l
I did it
same ^^"
I have this code inside getProfileInfo()
Copy code
let response = await this.httpService.get(this.discordAPIURL, { headers: headersRequest }).toPromise();
but can't really play without it
r
Hmm. That’s fine. That function gets called after init is complete anyway
Have you initialised the session recipe?
In the recipeList
l
no, will check
with it
r
Yea. So that’s the issue.
l
yep
didn't know when I forgot it
r
Hmm
l
now it's all good, thx
anyway, do you need a pseudo-code for Discord ? if anybody needs it I can share mine
so that people will stop ask ^^
r
I think it’s already there somewhere. But yea. Feel free to post it here. Or create another thread about it.
l
ho, didn't find it
r
Yeaaa. I don’t recall where it is. But it’s been shared before
l
I'm stupid, never used the pagination on search mod
xD