greymass / ual-anchor

Identity and session through ESR using EOSIO/universal-authenticator-library
MIT License
23 stars 16 forks source link

Inherit the appName from the generic UAL configuration instead of requiring it during ual-anchor instantiation #4

Open aaroncox opened 4 years ago

aaroncox commented 4 years ago

Currently ual-anchor throws an error if you don't include a name during its instantiation.

For example:

import AnchorLinkProvider from 'eos-transit-anchorlink-provider';

const context = initAccessContext({
  appName: 'dapp_name',
  walletProviders: [AnchorLinkProvider()]
});

This will throw an error unless you also pass the name to the AnchorLinkProvider constructor, like so:

import AnchorLinkProvider from 'eos-transit-anchorlink-provider';

const context = initAccessContext({
  appName: 'dapp_name',
  walletProviders: [AnchorLinkProvider('dapp_name')]
});

Ideally the AnchorLinkProvider should just inherit the name from the appName variable within the parent configuration.

aaroncox commented 4 years ago

Current with how the ual-reactjs-renderer (and I can assume ual-plainjs-renderer) are built, each individual authenticator has no sense of what the UAL provider appName value is when being constructed.

Changes to UAL will be required to accomplish this task.