Skip to content

Commit b59b0e6

Browse files
committed
ts: lib/auth/openid/index.js
1 parent 4963832 commit b59b0e6

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

lib/auth/openid/index.js renamed to lib/auth/openid/index.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
'use strict'
1+
import {Router} from "express";
2+
import * as passport from "passport";
3+
import {Strategy as OpenIDStrategy} from "@passport-next/passport-openid";
4+
5+
import * as config from "../../config";
6+
import * as models from "../../models";
7+
import * as logger from "../../logger";
8+
import {urlencodedParser} from "../../utils";
9+
import {setReturnToFromReferer} from "../utils";
210

3-
const Router = require('express').Router
4-
const passport = require('passport')
5-
const OpenIDStrategy = require('@passport-next/passport-openid').Strategy
6-
const config = require('../../config')
7-
const models = require('../../models')
8-
const logger = require('../../logger')
9-
const { urlencodedParser } = require('../../utils')
10-
const { setReturnToFromReferer } = require('../utils')
1111

1212
const openIDAuth = module.exports = Router()
1313

@@ -33,11 +33,15 @@ passport.use(new OpenIDStrategy({
3333
}
3434
if (needSave) {
3535
user.save().then(function () {
36-
if (config.debug) { logger.info('user login: ' + user.id) }
36+
if (config.debug) {
37+
logger.info('user login: ' + user.id)
38+
}
3739
return done(null, user)
3840
})
3941
} else {
40-
if (config.debug) { logger.info('user login: ' + user.id) }
42+
if (config.debug) {
43+
logger.info('user login: ' + user.id)
44+
}
4145
return done(null, user)
4246
}
4347
}

0 commit comments

Comments
 (0)