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

#161290964 Build local login feature #31

Merged
merged 1 commit into from
Dec 21, 2018

Conversation

tersoo-atsen
Copy link

@tersoo-atsen tersoo-atsen commented Dec 19, 2018

What does this PR do?

Have user be able to login to their Author's Haven accounts

Description of Task to be completed?

  • add tests
  • add login action creators
  • add welcome page component

How should this be manually tested?

  • run npm start to spin up the server
  • open localhost:3000 to view the landing page
  • use redux dev tool to observe the state and state history
  • navigate to the login page and login with a valid user email
  • go to your inbox look for the email from Author's Haven and click on the link
  • you should be directed to the welcome page and logged in now

Any background context you want to provide?

N/A

What are the relevant pivotal tracker stories?

#161290964

Screenshots (if appropriate)

screen shot 2018-12-19 at 3 07 28 pm

screen shot 2018-12-19 at 3 08 28 pm

screen shot 2018-12-16 at 12 42 26 pm

screen shot 2018-12-19 at 3 40 13 pm

Questions:

N/A

Review App

@KvNGCzA KvNGCzA temporarily deployed to valinor-ah-frontend-stag-pr-31 December 19, 2018 14:50 Inactive
@tersoo-atsen tersoo-atsen force-pushed the feature/161290964/local-login-feature branch from e314ee4 to 40a93cb Compare December 19, 2018 15:10
@tersoo-atsen tersoo-atsen temporarily deployed to valinor-ah-frontend-stag-pr-31 December 19, 2018 15:11 Inactive
Copy link

@sulenchy sulenchy left a comment

Choose a reason for hiding this comment

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

By default, the landing page displays an error from google. Below is the snapshot of the page
screen shot 2018-12-20 at 10 13 22 am

I think it is a bug

Copy link

@andela-moe andela-moe left a comment

Choose a reason for hiding this comment

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

In your App.js file on line 21 you happen to be using componentWillMount() which at this point has been deprecated and moreover if you would want to check the status of the user after the component (in this cace the App) is rendered then you would consider using ComponentDIdMount versus what you currently have.

This resource should provide more insight -> https://daveceddia.com/where-fetch-data-componentwillmount-vs-componentdidmount/

src/actions/loginActions.js Outdated Show resolved Hide resolved
src/actions/loginActions.js Outdated Show resolved Hide resolved
@tersoo-atsen tersoo-atsen force-pushed the feature/161290964/local-login-feature branch from 40a93cb to c65c952 Compare December 20, 2018 16:20
@tersoo-atsen tersoo-atsen temporarily deployed to valinor-ah-frontend-stag-pr-31 December 20, 2018 16:21 Inactive
@tersoo-atsen tersoo-atsen force-pushed the feature/161290964/local-login-feature branch from c65c952 to 459da6e Compare December 20, 2018 16:37
@tersoo-atsen tersoo-atsen temporarily deployed to valinor-ah-frontend-stag-pr-31 December 20, 2018 16:37 Inactive
@tersoo-atsen tersoo-atsen removed the request for review from mbilesanmi December 20, 2018 16:40
@@ -84,14 +102,14 @@ export class LoginPage extends Component {
{/* Email input div */}
<div id="login-form">
<h5>Sign in with your email</h5>
<form id="login-form">
<form onSubmit={this.handleSubmit} id="login-form">
<div className="row login-form-section text-center">
<div className="col-md-8 offset-md-2">
<div className="input-group mb-4 login-group">
<div className="input-group-prepend">
<span className="input-group-text transparent email-addon" id="basic-addon1"><img src={emailIcon} alt="email icon" /></span>
</div>

Choose a reason for hiding this comment

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

Trailing spaces not allowed no-trailing-spaces

)
.then(res => res.json(), error => dispatch(
globalFailure(['We were unable to log you in, please try again.', error])
))

Choose a reason for hiding this comment

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

Unexpected newline before ')' function-paren-newline

export const logUserIn = tokenQueryString => dispatch => fetch(
`${process.env.API_BASE_URL}/users/login${tokenQueryString}`
)
.then(res => res.json(), error => dispatch(

Choose a reason for hiding this comment

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

Unexpected newline after '(' function-paren-newline


export const logUserIn = tokenQueryString => dispatch => fetch(
`${process.env.API_BASE_URL}/users/login${tokenQueryString}`
)

Choose a reason for hiding this comment

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

Unexpected newline before ')' function-paren-newline

}
});

export const logUserIn = tokenQueryString => dispatch => fetch(

Choose a reason for hiding this comment

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

Unexpected newline after '(' function-paren-newline


export const sendEmailLink = email => dispatch => fetch(
`${process.env.API_BASE_URL}/users/login`, requestOptions({ email }, 'POST', null)
)

Choose a reason for hiding this comment

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

Unexpected newline before ')' function-paren-newline

import { globalLoading, globalFailure, globalLoggedIn } from './globalActions';
import requestOptions from '../utils/requestOptions';

export const sendEmailLink = email => dispatch => fetch(

Choose a reason for hiding this comment

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

Unexpected newline after '(' function-paren-newline

- add tests
- add login action creators
- add welcome page component

[Starts #161290964]
@tersoo-atsen
Copy link
Author

tersoo-atsen commented Dec 20, 2018

@sulenchy this problem has been resolved. The problem was my review app had not been added to the Google developer console.

@tersoo-atsen tersoo-atsen merged commit 41fdcc4 into develop Dec 21, 2018
@tersoo-atsen tersoo-atsen deleted the feature/161290964/local-login-feature branch December 21, 2018 09:37
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.

None yet

5 participants