feat: update logistration pages (#591)

- removed few unused classes
- updated login page to rely on error messages generated
from the frontend only.

VAN-138
This commit is contained in:
Zainab Amir
2022-06-30 17:02:04 +05:00
committed by GitHub
parent f066880c7c
commit 5f2570c440
10 changed files with 29 additions and 101 deletions

View File

@@ -1,17 +1,8 @@
// Utility functions
import * as QueryString from 'query-string';
import { AUTH_PARAMS } from '../constants';
export default function processLink(link) {
let matches;
link.replace(/(.*?)<a href=["']([^"']*).*?>([^<]+)<\/a>(.*)/g, function () { // eslint-disable-line func-names
matches = Array.prototype.slice.call(arguments, 1, 5); // eslint-disable-line prefer-rest-params
});
return matches;
}
export const getTpaProvider = (tpaHintProvider, primaryProviders, secondaryProviders) => {
let tpaProvider = null;
let skipHintedLogin = false;

View File

@@ -1,18 +1,5 @@
import { LOGIN_PAGE } from '../constants';
import processLink, { updatePathWithQueryParams } from './dataUtils';
describe('processLink', () => {
it('should use the provided processLink function to', () => {
const expectedHref = 'http://test.server.com/';
const expectedText = 'test link';
const link = `<a href="${expectedHref}">${expectedText}</a>`;
const matches = processLink(link);
expect(matches[1]).toEqual(expectedHref);
expect(matches[2]).toEqual(expectedText);
});
});
import { updatePathWithQueryParams } from './dataUtils';
describe('updatePathWithQueryParams', () => {
it('should append query params into the path', () => {

View File

@@ -1,5 +1,4 @@
export {
default,
getTpaProvider,
getTpaHint,
updatePathWithQueryParams,