swagger-magic-social-auth-handler

This module adds all the missing parts in the social auth aspect. It adds the relevant paths and definitons into the swagger spec and configure controllers to handle the social auth aspect.

Usage no npm install needed!

<script type="module">
  import swaggerMagicSocialAuthHandler from 'https://cdn.skypack.dev/swagger-magic-social-auth-handler';
</script>

README

Install

npm install swagger-magic-social-auth-handler --save

swagger-magic-social-auth-handler

This module adds all the missing parts to the auth aspect. It adds the relevant paths and definitons into the swagger spec and configure controller.

Params

  • swaggerObject Object - swagger spec representing the api
  • token Object - implementation of the swagger-magic-token-interface. required if securityDefinitions defined in the swagger spec
  • auth Object - implementation of the swagger-magic-social-auth-interface. required if x-swagger-magic-social defined in the swagger spec

Returns: Object - contains a mapping between path and a handler. {path1: function (req, res, next), path2: {req, res, next}}
Example

    var socialAuthHandler = require("swagger-magic-social-auth-handler");

    var socialAuthController = socialAuthHandler(swaggerObject, token, auth);

    if (socialAuthController) {
       _.each(socialAuthController, function (value, key) {
            app.get(key, value);
        });
    }