Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
674fa6da
authored
Apr 11, 2016
by
Pablo Molina
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Eliminados ficheros innecesarios
parent
30012267
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
40 deletions
sails/src/api/policies/#tokenAuth.js#
sails/src/assets/app/modules/student/controllers/#collections.js#
sails/src/api/policies/#tokenAuth.js#
deleted
100644 → 0
View file @
30012267
module.exports = function(req, res, next) {
var token;
//
// Token comes in the header
//
if (req.headers && req.headers.authorization) {
var parts = req.headers.authorization.split(' ');
if (parts.length == 2) {
var scheme = parts[0],
credentials = parts[1];
if (/^Bearer$/i.test(scheme)) {
token = credentials;
}
} else {
return res.json(401, {err: 'Format is Authorization: Bearer [token]'});
}
//
// Token comes as a parameter
//
} else if (req.param('token')) {
token = req.param('token');
// We delete the token from param to not mess with blueprints
delete req.query.token;
: } else {
return res.json(401, {err: 'No Authorization header was found'});
}
//
// We have a token, let's verify it
//
sailsTokenAuth.verifyToken(token, function(err, token) {
if (err) return res.json(401, {err: 'Invalid token'});
req.token = token;
next();
});
};
\ No newline at end of file
sails/src/assets/app/modules/student/controllers/#collections.js#
deleted
100644 → 0
View file @
30012267
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment