Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- method: 'GET',
- path: '/api/v1/user/profile/picture',
- options: {
- auth: {
- mode: 'required'
- },
- handler: function (request, reply) {
- if (request.auth.isAuthenticated) {
- let user_id = request.auth.credentials._id;
- console.log('/api/v1/user/profile/picture/' + user_id);
- return reply.redirect('/api/v1/user/profile/picture/' + user_id);
- } else {
- console.log("unauth");
- return boom.badRequest(errorCodes.InvalidSession.id);
- }
- }
- }
- },
- {
- method: 'GET',
- path: '/api/v1/user/profile/picture/{file*}',
- options: {
- auth: {
- mode: 'required'
- },
- handler: {
- directory: {
- path: './upload/user/pictures/profile_pic/'
- }
- }
- }
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement