Skip to content

Auth - #30

Open
bigcheeseh wants to merge 18 commits into
masterfrom
auth
Open

Auth#30
bigcheeseh wants to merge 18 commits into
masterfrom
auth

Conversation

@bigcheeseh

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/components/Header/Header.js Outdated
}

componentWillMount(){
const user = JSON.parse(localStorage.getItem("user"))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

If i am right, u can find all user data in firebase reducer, check it out.

Comment thread src/components/Header/Header.js Outdated
componentWillReceiveProps(nextProps){
const user = JSON.parse(localStorage.getItem("user"))
console.log(user)
this.setState({ user })

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

set state in componentWillMount and here?
why u set same user data twice?

}
}

case TYPES.CREATE_ACCOUNT_TO_INITIAL_ERROR: {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

what is this? :D


if(!action.payload){
console.log('group list is empty')
}else{

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

well done! :)

Comment thread src/routs.js
<Route exact path='/:groupTitle' component={GroupPage} />
<Route path='/programs' component={Programs} />
<Route path='/chat' component={Chat} />
<Route exact path='/administration/register' component={Register} />

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

administrator register?
u have logic for admins?

Kronenberg
Kronenberg previously approved these changes Jan 27, 2018

@Kronenberg Kronenberg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Resolve the conflicts and push :D

Comment thread src/actions/auth.js Outdated
firebase.auth().createUserWithEmailAndPassword(email, password)
.then((userData) => {

localStorage.setItem("user", JSON.stringify({ email, "registration": true, "login": false }))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

ребят, я вам в прошлый раз говорил что именно надо сохранять если вы внимательно слушали!
нужно сохранять только токен юзера и все! то что вы делаете это bad practice, объекты сохранять это не кошерно! :( очень плохо

Comment thread src/actions/auth.js Outdated
.then((userData)=>{

// add this user to local storage
localStorage.setItem("user", JSON.stringify({ email, "registration": true, "login": false }))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

same here.... :(

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.

4 participants