Hi, can someone help me with setting up a custom d...
# ask-a-descoper
q
Hi, can someone help me with setting up a custom domain on your side? I sent an email to support two days ago, but didn't get any reply...
s
Sure, @rich-branch-49281 can you help here?
r
Hi @quiet-school-69382, You will need to create a CNAME record that points to cname.descope.com for example:
<http://auth.mydomain.com|auth.mydomain.com> CNAME <http://cname.descope.com|cname.descope.com>;
Please update me here once done and tell me which hostname you choose so we can enable it on our side as well.
q
Hi, already did it 2 days ago. This is the domain we set the CNAME for
<http://auth.lender-dev.twelvegrow.com|auth.lender-dev.twelvegrow.com>
r
It looks like it works
q
What do you mean? how to you see it?
BTW, we set the CNAME to api.descope.com according to the documentation, is it ok?
Regarding the cname to api.descope.com it currently works exactly the same but in order to make it "work forever" it should point to cname.descope.com so we can manage it safer.
s
@quiet-school-69382 where in docs you saw it needs to point to api.descope.com ?
q
s
Eli I see there only cname.descope.com
q
@rich-branch-49281 Something not working for me, after I login and refresh the page it throws me back to the login, and if I switch back to "Manage in response body" every thing works fine
@square-vr-55083
s
Ohhh, I see now, in the text it says, CNAME but in image it wrong, will fix that
q
Right, missed the text, I only look at the pictures 😅
s
@quiet-school-69382 which value are you putting in the "manage in cookies" option when you switch?
q
s
do you see the cookies DS and DSR in your browser ?
q
Yes
Ha, only DSR
s
You are now on which option, the cookies one ? Or manage in body ?
Also which SDK are you using ?
Frontend
q
Cookies
react
s
can you try to login again from incognito ?
you get same error ?
q
yes, same thing
BTW, in incognito I don't see any cookies, how should it work with cookies in incognito?
s
what is your app url ?
any console errors you see on your browser ? let's go back to non incognito browser
q
message has been deleted
s
what is your project ID ?
q
P2PsDWY4DmOZogn9Naf2rLJreiIy
s
ohh, have you setup base url in react SDK ?
q
No...
change the base url
q
I see, so the base url should be the same as the custom domain?
s
yep
q
Great, will check it now
@square-vr-55083 Can't make it to work...
When I set this as baseUrl 'lender-dev.twelvegrow.com' I get this error
When I tried to set
<https://lender-dev.twelvegrow.com>
I got this error:
s
q
YES, it works!
🎉 1
Many thanks!
s
Great ! Sorry about the docs not being clear enough, we will fix ASAP those
👍 1
We are also planning to make this custom domain part self service, from our console UI soon, that will make this process more streamlined
👍 1
q
Yeah, a specific domain example for the baseUrl would be great
b
Eli - we are both adding this to the product, but also creating an example document for this exactly. Will keep you posted.
s
@rich-branch-49281 @orange-belgium-27264 I'll forward you an email. Eli requested further CNAMEs.
🙏 1
q
Hi @square-vr-55083, I have an issue with
logout
I'm not sure if it's related to what we discussed here or I am just missing out something. I am using the react SDK and implement the
logout
as shown in your Github repo. The issue is that after the logout I see that the cookie still exists and therefore when I refresh the page the user is still logged in
BTW, there's an error returning from the logout request
s
checking
🙏 1
@quiet-school-69382 can you try to clear all cookies , login again, than try to logout again ?
q
Yes, same thing
s
in your cookies , for your app, do you see a cookie called
DSR
?
q
Yes
But wait, I think it's something on my side...
I am checking
s
ok, I can say I see the refresh JWT is not valid on our side, seems like an
Copy code
[object...
q
Ok, it's not on my side, I had a piece of code that was generating the DSR cookie for working on localhost, but it's no longer there
s
ok, so all working well now ?
q
No, I thought It's on my side, but it's not...
s
so you get same error ?
can you open that DSR token value ? is it a valid JWT ?
q
Yes, same error
s
as best practice, don't post whole JWT in channel, send in DM
👍 1
also, send me the HAR file of the logout part
q
What is it? or do I find it?
do you happen to have also a DSR key under local storage ?
q
Nothing appears under
WS
the developer tools
s
check here, which cookies have been sent
q
There is DSR under local storage, only DS
s
in the cookies sent on the req, you see DSR ? the value of it same as you posted ?
q
message has been deleted
Yes, they are the same
s
is this for project that starts with
P2QbdZn9xO6G1RFvTFn...
?
q
Yes
s
in the headers section, is there an Authorization header ?
also, you meant here , no DSR right ? in local storage ?
q
Right, sorry, no DSR in local storage
Yes, the header doesn't look ok...
s
ok, about Authorization header
q
Wait... in my app I am using the `axios`package and I am attaching the auth header to all requests that are going out, if your sdk using also
axios
, maybe that's the problem...
s
nope, react sdk uses fetch, not axios does the header look like this (with your project id the value)?
q
Yes
s
ohh sorry, missed the header msg, I see now the issue
any chance you called the
logout
func with some argument ?
can you paste here the code snippet ?
q
But it has the [object Object] in end of the header
I call the logout function without any arguments
s
yes, that is the issue , just need to understand how the
[object Object]
got there
q
message has been deleted
message has been deleted
It's in the same file, just a lot of code in between
a
Hi
Managed to reproduce
Please do the following and it will solve that problem:
Instead of:
onClick={logout}
Do:
onClick={handleLogout}
And handleLogout should be an inner function in your app code which will call the logout()
Like:
message has been deleted
The problem is that we are getting the event as the first argument and use it as a token, so just wrap it with a inner func and call the logout without any argument and it will work.
q
Ok, I will try and report back...
Yep, it's working... 🙏
a
Cool, we will fix this.
Thanks!