-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Facebook): Implementing Facebook auth
- Loading branch information
1 parent
a72fe76
commit 84c5eff
Showing
13 changed files
with
814 additions
and
518 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<template> | ||
<VFacebookLogin ref="facebook" :app-id="appId" :login-options="loginOptions" @login="login" @sdk-init="initSDK"/> | ||
</template> | ||
|
||
<script> | ||
import { mapActions } from "vuex"; | ||
import VFacebookLogin from "vue-facebook-login-component"; | ||
import Config from "../../../../config"; | ||
export default { | ||
name: "FacebookLoginButton", | ||
components: { VFacebookLogin }, | ||
data() { | ||
return { | ||
SDK: undefined, | ||
appId: Config.facebook.app.ID, | ||
version: "v10.0", | ||
loginOptions: { | ||
scope: "email", | ||
// eslint-disable-next-line camelcase | ||
auth_type: "rerequest", | ||
}, | ||
}; | ||
}, | ||
methods: { | ||
...mapActions("user", { loginWithFacebook: "loginWithFacebook" }), | ||
initSDK(SDK) { | ||
this.SDK = SDK; | ||
}, | ||
async login(data) { | ||
try { | ||
if (data) { | ||
await this.loginWithFacebook(data.authResponse.accessToken); | ||
this.$emit("hide-account-modal"); | ||
this.SDK.scope.logout(); | ||
} | ||
} catch (err) { | ||
this.$error.display(err); | ||
} | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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