                 console.log("local strategy validating user #{username}")
                 done(null, {username:username})
 
-            passport.use(new LocalStrategy(verify))
+            passport.use(new PassportStrategy(verify))
 
             app.get '/auth/local', (req, res) ->
                 console.log('get login form')


    settings = database.key_value_store(name:'passport_settings')
    get_conf = (strategy, cb) ->
        database.select_one
            table  : 'passport_settings'
            where  :
                strategy : strategy
            columns: ['conf']
            cb     : (err, result) ->
                if err
                    cb(err)
                else
                    cb(undefined, result[0])

    get_conf 'site_conf', (err, site_conf) ->
        auth_url = site_conf.auth

        init_passport_local = (cb) ->
            # Strategy: local email address / password login
            LocalStrategy = require('passport-local').Strategy

            verify = (username, password, done) ->
                if username == 'a'

            cb()

        init_passport_google = (cb) ->
            dbg("init_passport_google")
            # Strategy: Google OAuth 2 -- https://github.com/jaredhanson/passport-google-oauth
            #
            # NOTE: The passport-recommend library passport-google uses openid2, which
            # is deprecated in a few days!   So instead, I have to use oauth2, which
            # is in https://github.com/jaredhanson/passport-google-oauth, which I found by luck!?!
            #
            PassportStrategy = require('passport-google-oauth').OAuth2Strategy
            strategy = 'google'
            get_conf strategy, (err, conf) ->
                if err or not conf?
                    cb(err)
                    return
                # docs for getting these for your app
                # https://developers.google.com/accounts/docs/OpenIDConnect#appsetup
                #
                # You must then put them in the database, via
                #   update passport_settings set conf['clientID']='...'     where strategy='google';
                #   update passport_settings set conf['clientSecret']='...' where strategy='google';
                #
                opts =
                    clientID     : conf.clientID
                    clientSecret : conf.clientSecret
                    callbackURL  : "#{auth_url}/#{strategy}/return"

                verify = (accessToken, refreshToken, profile, done) ->
                    console.log("#{strategy} auth: accessToken=",accessToken, " profile=", profile, "refreshToken=", refreshToken)
                    done(undefined, {profile:profile})
                passport.use(new PassportStrategy(opts, verify))

                # Enabling "profile" below I think required that I explicitly go to Google Developer Console for the project,
                # then select API&Auth, then API's, then Google+, then explicitly enable it.  Otherwise, stuff just mysteriously
