GoogleOauth2.0 First implementation
First try for GoogleOauth2.0
This commit is contained in:
21
express-server/node_modules/uid2/LICENSE
generated
vendored
Normal file
21
express-server/node_modules/uid2/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 Marco Aurelio
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
55
express-server/node_modules/uid2/index.js
generated
vendored
Normal file
55
express-server/node_modules/uid2/index.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
var crypto = require('crypto');
|
||||
|
||||
/**
|
||||
* 62 characters in the ascii range that can be used in URLs without special
|
||||
* encoding.
|
||||
*/
|
||||
var UIDCHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
|
||||
/**
|
||||
* Make a Buffer into a string ready for use in URLs
|
||||
*
|
||||
* @param {String}
|
||||
* @returns {String}
|
||||
* @api private
|
||||
*/
|
||||
function tostr(bytes) {
|
||||
var chars, r, i;
|
||||
|
||||
r = [];
|
||||
for (i = 0; i < bytes.length; i++) {
|
||||
r.push(UIDCHARS[bytes[i] % UIDCHARS.length]);
|
||||
}
|
||||
|
||||
return r.join('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an Unique Id
|
||||
*
|
||||
* @param {Number} length The number of chars of the uid
|
||||
* @param {Number} cb (optional) Callback for async uid generation
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function uid(length, cb) {
|
||||
|
||||
if (typeof cb === 'undefined') {
|
||||
return tostr(crypto.pseudoRandomBytes(length));
|
||||
} else {
|
||||
crypto.pseudoRandomBytes(length, function(err, bytes) {
|
||||
if (err) return cb(err);
|
||||
cb(null, tostr(bytes));
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports
|
||||
*/
|
||||
|
||||
module.exports = uid;
|
34
express-server/node_modules/uid2/package.json
generated
vendored
Normal file
34
express-server/node_modules/uid2/package.json
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"_from": "uid2@0.0.x",
|
||||
"_id": "uid2@0.0.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=",
|
||||
"_location": "/uid2",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "uid2@0.0.x",
|
||||
"name": "uid2",
|
||||
"escapedName": "uid2",
|
||||
"rawSpec": "0.0.x",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.0.x"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/passport-oauth2"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz",
|
||||
"_shasum": "483126e11774df2f71b8b639dcd799c376162b82",
|
||||
"_spec": "uid2@0.0.x",
|
||||
"_where": "C:\\Users\\Georg\\GitHub\\SmartShopper\\express-server\\node_modules\\passport-oauth2",
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "strong uid",
|
||||
"name": "uid2",
|
||||
"tags": [
|
||||
"uid"
|
||||
],
|
||||
"version": "0.0.3"
|
||||
}
|
Reference in New Issue
Block a user