Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): added logout functionality to epic #17045

Merged
merged 4 commits into from
Feb 28, 2020
Merged

feat(ui): added logout functionality to epic #17045

merged 4 commits into from
Feb 28, 2020

Conversation

asalem1
Copy link
Contributor

@asalem1 asalem1 commented Feb 28, 2020

This is PR part of a larger PR that is intended to add sign-in functionality to IDPE. This particular PR deals specifically with logging out and allowing users to logout using the existing logout button

@asalem1 asalem1 requested a review from TCL735 February 28, 2020 13:49
@asalem1 asalem1 requested a review from TCL735 February 28, 2020 19:26
@asalem1 asalem1 requested a review from desa February 28, 2020 20:15
@desa desa requested review from drdelambre and removed request for desa February 28, 2020 20:38

useEffect(() => {
handleSignOut()
}, [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

// Utils
import {isFlagEnabled} from 'src/shared/utils/featureFlag'

const Logout: FC<WithRouterProps> = ({router}) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need some more types in here. try running this in influxdb/ui:
yarn tsc -noImplicitAny | grep -A 3 -i "$(git diff --name-status master | awk '{ print substr($2,4) }')


export const getAuth0Config = async (): Promise<Auth0Config> => {
try {
const {data} = await AJAX({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you doubling down on using the old request library for new features?

https://giphy.com/embed/AuIvUrZpzBl04

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great question. I did a global search of influxdb for /api/v2private and followed that convention since we aren't actually generating a route for this particular endpoint on IDPE

Copy link
Contributor

@drdelambre drdelambre Feb 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use fetch then to keep consistency with oats

@@ -76,6 +71,16 @@ class LoginPageContents extends PureComponent<DispatchProps> {
confirmPasswordError: '',
}

public async componentDidMount() {
const config = await getAuth0Config()
this.auth0 = auth0js.WebAuth({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dope

@asalem1 asalem1 merged commit d5e307a into login-epic Feb 28, 2020
@asalem1 asalem1 deleted the logout-func branch February 28, 2020 22:09
asalem1 added a commit that referenced this pull request Mar 6, 2020
refactored the logout component and added in logout functionality behind a feature flag
asalem1 added a commit that referenced this pull request Mar 9, 2020
refactored the logout component and added in logout functionality behind a feature flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants