Skip to content

Commit

Permalink
Remove unnecessary test imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed Apr 18, 2024
1 parent 7fc82a2 commit e057440
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ export class LoginClient {
/**
* @description When a platform extension attempts to log a user in, the Authress Login page will redirect to your Platform defaultAuthenticationUrl. At this point, show the user the login screen, and then pass the results of the login to this method.
* @param {ExtensionAuthenticationParameters} settings Parameters for controlling how and when users should be authenticated for the app.
* @return {Promise<AuthenticateResponse?>} Automatically redirects the user to the appropriate location, unless the connectionId matches a legacy authentication flow.
* @return {Promise<AuthenticateResponse | null>} Automatically redirects the user to the appropriate location, unless the connectionId matches a legacy authentication flow.
*/
updateExtensionAuthenticationRequest(settings: ExtensionAuthenticationParameters): Promise<AuthenticateResponse?>;
updateExtensionAuthenticationRequest(settings: ExtensionAuthenticationParameters): Promise<AuthenticateResponse | null>;

/**
* @description Unlink an identity from the user's account.
Expand All @@ -191,9 +191,9 @@ export class LoginClient {
/**
* @description Logs a user in, if the user is not logged in, will redirect the user to their selected connection/provider and then redirect back to the {@link redirectUrl}. If neither the {@link connectionId} nor the {@link tenantLookupIdentifier} is specified the user will be directed to the Authress hosted login page to select their preferred login method.
* @param {AuthenticationParameters} [settings] Parameters for controlling how and when users should be authenticated for the app.
* @return {Promise<AuthenticateResponse?>} Automatically redirects the user to the appropriate location, unless the connectionId matches a legacy authentication flow.
* @return {Promise<AuthenticateResponse | null>} Automatically redirects the user to the appropriate location, unless the connectionId matches a legacy authentication flow.
*/
authenticate(settings?: AuthenticationParameters): Promise<AuthenticateResponse?>;
authenticate(settings?: AuthenticationParameters): Promise<AuthenticateResponse | null>;

/**
* @description Ensures the user's bearer token exists. To be used in the Authorization header as a Bearer token. This method blocks on a valid user session being created, and expects {@link authenticate} to have been called first. Additionally, if the application configuration specifies that tokens should be secured from javascript, the token will be a hidden cookie only visible to service APIs and will not be returned. If the token is expired and the session is still valid, then it will automatically generate a new token directly from Authress.
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ class LoginClient {
* @param {String} [connectionId] Specify which provider connection that user would like to use to log in - see https://authress.io/app/#/manage?focus=connections
* @param {String} [tenantLookupIdentifier] Instead of connectionId, specify the tenant lookup identifier to log the user with the mapped tenant - see https://authress.io/app/#/manage?focus=tenants
* @param {Object} [connectionProperties] Connection specific properties to pass to the identity provider. Can be used to override default scopes for example.
* @return {Promise<AuthenticateResponse?>} The authentication response.
* @return {Promise<AuthenticateResponse | null>} The authentication response.
*/
async updateExtensionAuthenticationRequest({ state, connectionId, tenantLookupIdentifier, connectionProperties }) {
if (!connectionId && !tenantLookupIdentifier) {
Expand Down Expand Up @@ -589,7 +589,7 @@ class LoginClient {
* @param {Boolean} [force=false] Force getting new credentials.
* @param {Boolean} [multiAccount=false] Enable multi-account login. The user will be prompted to login with their other account, if they are not logged in already.
* @param {Boolean} [clearUserDataBeforeLogin=true] Remove all cookies, LocalStorage, and SessionStorage related data before logging in. In most cases, this helps prevent corrupted browser state from affecting your user's experience.
* @return {Promise<AuthenticateResponse?>} The authentication response.
* @return {Promise<AuthenticateResponse | null>} The authentication response.
*/
async authenticate(options = {}) {
const { connectionId, tenantLookupIdentifier, inviteId, redirectUrl, force, responseLocation, flowType, connectionProperties, openType, multiAccount, clearUserDataBeforeLogin } = (options || {});
Expand Down
2 changes: 0 additions & 2 deletions tests/util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ const { describe, it, beforeEach, afterEach } = require('mocha');
const sinon = require('sinon');
const { expect } = require('chai');

const { LoginClient } = require('../src/index');
const windowManager = require('../src/windowManager');
const { sanitizeUrl } = require('../src/util');

let sandbox;
Expand Down

0 comments on commit e057440

Please sign in to comment.