/seminar

2013년 03월 이후로 진행하는 모든 세미나 파일을 저장합니다.

Primary LanguageJavaScript

#Seminar

실습이 있는 세미나의 실습 자료입니다.

2013년

2013년 03월 28일 SKT 세미나 - T Cloud Biz Studio - 을지로 SK T 타워 19층 대회의실 A

redis

MongoDB

Putty & FileZilla

Cookie Parser

// 기본 함수를 추출합니다.
var parse = require('express/node_modules/cookie').parse;
var parseSigned = require('express/node_modules/connect/lib/utils').parseSignedCookies;
var parseCookie = function (cookie) {
    return parseSigned(parse(cookie), 'your secret here')
};

기본 인증

exports.active = function (everyauth, db) {
    // EveryAuth 모듈의 기본 설정을 합니다.
    var auth = everyauth.password.loginWith('login');
    everyauth.everymodule.userPkey('_id');
    everyauth.everymodule.findUserById(function (id, callback) {
        db.users.findOne({
            _id: db.ObjectId(id)
        }, function (error, user) {
            callback(error, user);
        });
    });

    // 로그아웃 설정
    everyauth.everymodule.logoutPath('/logout');
    everyauth.everymodule.logoutRedirectPath('/login');

    // 가입 설정
    auth.registerView('register');
    auth.getRegisterPath('/register');
    auth.postRegisterPath('/register');
    auth.extractExtraRegistrationParams(function (request) { });
    auth.validateRegistration(function (userAttribute, errors) { });
    auth.registerUser(function (userAttribute) { });
    auth.registerSuccessRedirect('/');

    // 로그인 설정
    auth.loginView('login');
    auth.getLoginPath('/login');
    auth.postLoginPath('/login')
    auth.authenticate(function (email, password) { });
    auth.loginSuccessRedirect('/');
};

DNomade 세미나