0.0.3 • Published 9 years ago

swagger-magic-social-auth-handler v0.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

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);
        });
    }