auth-module icon indicating copy to clipboard operation
auth-module copied to clipboard

Can a local scheme have an endpoint which is a javascript custom function and not a axios api call

Open rmrbytes opened this issue 3 years ago • 0 comments

Hello:

I have a need where after getting the username and password of a user, I wish to call a javascript function (which does whatever) to confirm successful login. Would something like this be possible using the auth-module

  strategies: {
    local: {
      token: {
        property: 'token',
        global: true,
        // required: true,
        // type: 'Bearer'
      },
      user: {
        property: 'user',
        // autoFetch: true
      },
      endpoints: {
        login: { url: '/api/auth/login', method: 'post' }, // is there a way to call a javascript function HERE
        logout: { url: '/api/auth/logout', method: 'post' },
        user: { url: '/api/auth/user', method: 'get' }
      }
    }
  }
}

I looked at the documentation of the customscheme (https://auth.nuxtjs.org/guide/scheme#creating-your-own-scheme) but could not determine where to place the custom js function.

Thanks

Thanks

rmrbytes avatar Aug 28 '22 03:08 rmrbytes