Created
November 13, 2021 16:41
-
-
Save hieptl/a69fb04137a31b03f39e44f1921fea8d to your computer and use it in GitHub Desktop.
Login.js - Login CometChat - Discord Clone
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
const loginCometChat = (user) => { | |
const authKey = `${process.env.REACT_APP_COMETCHAT_AUTH_KEY}`; | |
cometChat.login(user.id, authKey).then( | |
User => { | |
localStorage.setItem('auth', JSON.stringify(user)); | |
setUser(user); | |
setIsLoading(false); | |
history.push('/'); | |
}, | |
error => { | |
} | |
); | |
}; | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment