Can you use vue-authenticate oauth without a callback?

227 Views Asked by At

When using vue-google-oauth2 you can use getAuthCode() to receive the code back to the frontend framework, which can then be passed to the backend/API for exchanging tokens/etc.

      this.$gAuth.getAuthCode()
      .then(authCode => {
      //on success
      return this.$http.post('http://your-backend-server.com/auth/google', { code: authCode})
})

My app works correct, when using this package, but I'd like to use vue-authenticate for other platforms like twitter and facebook. The reason why I use this method is to pass a JWT, with the authcode for the middleware on the backend to verify the user, then exchange the tokens.

When using vue-authenticate there are not parameters to NOT use a callback. Eg:

  methods:{
    authenticate: function (provider) {
      this.$auth.authenticate(provider).then(
        console.log("should have some info??")
      )
    },

Example is using: redirectUri: "https://www.facebook.com/connect/login_success.html" to not use a callback.

Shouldn't the console be at least logging this? And is there a better option for this type of workflow?

Thank you.

0

There are 0 best solutions below