Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

"Sign in with SkyID" should use the same portal as the Skapp #3

Open
Delivator opened this issue Nov 2, 2020 · 9 comments
Open

"Sign in with SkyID" should use the same portal as the Skapp #3

Delivator opened this issue Nov 2, 2020 · 9 comments
Assignees

Comments

@Delivator
Copy link
Contributor

It looks like as of right now the Sign in with SkyID popup is hard coded to siasky.net.
Imo that popup should use the same portal as the Skapp requesting a sign in when possible.

msedge_v1TqOynkVe

@DaWe35 DaWe35 self-assigned this Nov 12, 2020
@mike76-dev
Copy link
Contributor

SkyID uses siasky.net in DevMode by default; when not in DevMode, default skynet-js portal is used (which is again siasky.net).
Should allow specifying custom portal in both cases.

@DaWe35
Copy link
Owner

DaWe35 commented Nov 16, 2020

@mike76-dev I think Delivator mentioned that the SkyID connect page always opens on siasky.net:

'https://sky-id.hns.siasky.net/connect.html?appId=' + this.appId + devModeString,

I don't know how we can solve this btw.

@mike76-dev
Copy link
Contributor

Can't you just add Portal option to this.opts? Then you can pass it on to new SkynetClient().
Alternatively, you can use a global skynetPortal variable and access it via setDefaultPortal() or something like that.

@DaWe35
Copy link
Owner

DaWe35 commented Nov 18, 2020

Can't you just add Portal option to this.opts? Then you can pass it on to new SkynetClient().
Alternatively, you can use a global skynetPortal variable and access it via setDefaultPortal() or something like that.

Yeah but the thing is that we want to open SkyID on the portal that you're currently using. So if you open https://sky-note.hns.skyportal.xyz we should open the popup with skyportal.xyz url

@mike76-dev
Copy link
Contributor

So, we can split the problem into two parts:

  1. Find out the portal where the page is open
  2. Pass this portal as an option to the popup
    Can you do No.1?

@DaWe35
Copy link
Owner

DaWe35 commented Nov 19, 2020

@mike76-dev When I started write this comment I thought it is impossoble, because there are portals running on subdomains, for example https://skynet.tutemwesi.com. But then I realized we already have a code what does something similar. I'll check it out.

@DaWe35
Copy link
Owner

DaWe35 commented Feb 9, 2021

Redsolver's solution: final portal = host.split('.hns.').last;

@mike76-dev
Copy link
Contributor

That should work.
But what about the case when the url is entered as https://siasky.net/hns/domain?

@DaWe35
Copy link
Owner

DaWe35 commented Feb 10, 2021

I think SkyID already redirects it to domain.hns.siasky.net. I will double-check, thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants