MCPcopy Create free account
hub / github.com/codecombat/codecombat / onClickFacebookLoginButton

Method onClickFacebookLoginButton

app/views/core/AuthModal.js:252–281  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

250 // Facebook
251
252 onClickFacebookLoginButton () {
253 const btn = this.$('#facebook-login-btn')
254 return application.facebookHandler.connect({
255 context: this,
256 success (response) {
257 btn.find('.sign-in-blurb').text($.i18n.t('login.logging_in'))
258 btn.attr('disabled', true)
259 return application.facebookHandler.loadPerson({
260 context: this,
261 success (facebookAttrs) {
262 const existingUser = new User()
263 return existingUser.fetchFacebookUser(facebookAttrs.facebookID, response?.authResponse?.accessToken, {
264 success: () => {
265 return me.loginFacebookUser(facebookAttrs.facebookID, response?.authResponse?.accessToken, {
266 success: () => {
267 application.tracker.identifyAfterNextPageLoad()
268 return application.tracker.identify().then(() => {
269 return loginNavigate(this.subModalContinue)
270 })
271 },
272 error: this.onFacebookLoginError,
273 })
274 },
275 error: this.onFacebookLoginError,
276 })
277 },
278 })
279 },
280 })
281 }
282
283 onFacebookLoginError (res) {
284 this?.$('#unknown-error-alert').addClass('hide')

Callers

nothing calls this directly

Calls 1

connectMethod · 0.45

Tested by

no test coverage detected