mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-01 11:09:14 +00:00
fix(ui): eliminate username logic from signIn process (#10131)
* fix(ui): eliminate username logic from signIn process * fix failing cypress --------- Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com>
This commit is contained in:
parent
b62f97f27b
commit
fe03e51cfe
@ -62,26 +62,30 @@ describe('Login flow should work properly', () => {
|
||||
|
||||
// Login with the created user
|
||||
|
||||
// login(CREDENTIALS.email, CREDENTIALS.password);
|
||||
// cy.goToHomePage();
|
||||
// cy.url().should('eq', `${BASE_URL}/my-data`);
|
||||
login(CREDENTIALS.email, CREDENTIALS.password);
|
||||
cy.goToHomePage();
|
||||
cy.url().should('eq', `${BASE_URL}/my-data`);
|
||||
|
||||
// //Verify user profile
|
||||
// cy.get('[data-testid="avatar"]').first().should('be.visible').trigger('mouseover').click();
|
||||
// Verify user profile
|
||||
cy.get('[data-testid="avatar"]')
|
||||
.first()
|
||||
.should('be.visible')
|
||||
.trigger('mouseover')
|
||||
.click();
|
||||
|
||||
// cy.get('[data-testid="user-name"]')
|
||||
// .should('be.visible')
|
||||
// .invoke('text')
|
||||
// .should('contain', `${CREDENTIALS.firstName}${CREDENTIALS.lastName}`);
|
||||
// interceptURL('GET', 'api/v1/users/name/*', 'getUserPage');
|
||||
// cy.get('[data-testid="user-name"]')
|
||||
// .should('be.visible')
|
||||
// .click({ force: true });
|
||||
// verifyResponseStatusCode('@getUserPage', 200);
|
||||
// cy.get('[data-testid="left-panel"]').should(
|
||||
// 'contain',
|
||||
// `${CREDENTIALS.firstName}${CREDENTIALS.lastName}`
|
||||
// );
|
||||
cy.get('[data-testid="user-name"]')
|
||||
.should('be.visible')
|
||||
.invoke('text')
|
||||
.should('contain', `${CREDENTIALS.firstName}${CREDENTIALS.lastName}`);
|
||||
interceptURL('GET', 'api/v1/users/name/*', 'getUser');
|
||||
cy.get('[data-testid="user-name"]')
|
||||
.should('be.visible')
|
||||
.click({ force: true });
|
||||
verifyResponseStatusCode('@getUser', 200);
|
||||
cy.get('[data-testid="left-panel"]').should(
|
||||
'contain',
|
||||
`${CREDENTIALS.firstName}${CREDENTIALS.lastName}`
|
||||
);
|
||||
});
|
||||
|
||||
it('Signin using invalid credentials', () => {
|
||||
|
||||
@ -80,7 +80,7 @@ Cypress.Commands.add('loginByGoogleApi', () => {
|
||||
Cypress.Commands.add('goToHomePage', () => {
|
||||
interceptURL('GET', '/api/v1/system/entities/count', 'count');
|
||||
interceptURL('GET', '/api/v1/feed*', 'feed');
|
||||
interceptURL('GET', '/api/v1/users/name/*?fields=*', 'userProfile');
|
||||
interceptURL('GET', '/api/v1/users/*?fields=*', 'userProfile');
|
||||
cy.get('[data-testid="whats-new-dialog"]')
|
||||
.should('exist')
|
||||
.then(() => {
|
||||
|
||||
@ -34,7 +34,7 @@ import React, {
|
||||
import { useHistory, useLocation } from 'react-router-dom';
|
||||
import axiosClient from 'rest/index';
|
||||
import { fetchAuthenticationConfig, fetchAuthorizerConfig } from 'rest/miscAPI';
|
||||
import { getLoggedInUser, getUserByName, updateUser } from 'rest/userAPI';
|
||||
import { getLoggedInUser, updateUser } from 'rest/userAPI';
|
||||
import appState from '../../../AppState';
|
||||
import { NO_AUTH } from '../../../constants/auth.constants';
|
||||
import { REDIRECT_PATHNAME, ROUTES } from '../../../constants/constants';
|
||||
@ -46,7 +46,6 @@ import jsonData from '../../../jsons/en';
|
||||
import {
|
||||
extractDetailsFromToken,
|
||||
getAuthConfig,
|
||||
getNameFromEmail,
|
||||
getUrlPathnameExpiry,
|
||||
getUserManagerConfig,
|
||||
isProtectedRoute,
|
||||
@ -329,7 +328,7 @@ export const AuthProvider = ({
|
||||
authConfig?.provider === AuthType.Basic
|
||||
? userAPIQueryFields + ',' + isEmailVerifyField
|
||||
: userAPIQueryFields;
|
||||
getUserByName(getNameFromEmail(user.profile.email), fields)
|
||||
getLoggedInUser(fields)
|
||||
.then((res) => {
|
||||
if (res) {
|
||||
const updatedUserData = getUserDataFromOidc(res, user);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user