Skip to content

Commit

Permalink
fix(continueTo): resupport continueTo
Browse files Browse the repository at this point in the history
  • Loading branch information
mt-max committed May 21, 2019
1 parent 1d1a302 commit c71c280
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Config properties:
response_type, // string; // Tells the authorization server which grant to execute.
scope, // string[]; // A list of permissions that the application requires.
redirectUri, // string; // URI to return the user to after authorization is complete.
continueTo, // string; // [optional] Parameter appended as `continue` to the `redirectUri`.
locale, // string; // [optional] To force the display to a specific language (e.g.: en-AU)
state, // string; // [optional] An opaque value, used for security purposes. If this request parameter is set in the request, then it is returned to the application as part of the redirect_uri.
appToken, // string; // [optional] The Access Token granted through oauth
Expand Down
File renamed without changes.
30 changes: 17 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DOMAIN, MY_ACCOUNT, VAULT } from './endpoints';

interface IConfig {
clientId: string;
scope: string[];
scope?: string[];
isTestEnvironment?: boolean;
redirectUri?: string;
continueTo?: string;
Expand All @@ -16,13 +16,14 @@ interface IConfig {
interface IParams {
client_id: string;
locale?: string;
continueTo?: string;

This comment has been minimized.

Copy link
@mt-micky

mt-micky May 22, 2019

Contributor

No thank you

}

interface IOauthParams {
export interface IOauthParams {
client_id: string;
redirect_uri: string;
response_type: string;
scope: string;
scope?: string;
state?: string;
}

Expand Down Expand Up @@ -65,19 +66,21 @@ class LinkSDK {
responseType = 'token',
scope = [],
locale,
state
state,
continueTo
} = config;

this.params = {
client_id: clientId,
locale
locale,
continueTo
};

this.oauthParams = {
client_id: clientId,
redirect_uri: redirectUri,
response_type: responseType,
scope: scope.join(' '),
scope: scope.length ? scope.join(' ') : undefined,
state
};

Expand All @@ -93,13 +96,14 @@ class LinkSDK {
const { newTab = false, email, authPage, backTo, showAuthToggle } = options;

const params = encodeConfigWithParams(
{ ...this.oauthParams, ...this.params }, {
email,
sdk_platform: 'js',
sdk_version: VERSION,
auth_action: authPage,
back_to: backTo,
show_auth_toggle: showAuthToggle
{ ...this.oauthParams, ...this.params },
{
email,
sdk_platform: 'js',
sdk_version: VERSION,
auth_action: authPage,
back_to: backTo,
show_auth_toggle: showAuthToggle
}
);

Expand Down

0 comments on commit c71c280

Please sign in to comment.