Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .autod.conf.js

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI

on:
push:
branches: [ master ]

pull_request:
branches: [ master ]

workflow_dispatch: {}

jobs:
Job:
name: Node.js
uses: artusjs/github-actions/.github/workflows/node-test.yml@v1
with:
os: 'ubuntu-latest'
version: '14, 16, 18'
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release

on:
push:
branches: [ master ]

workflow_dispatch: {}

jobs:
release:
name: Node.js
uses: artusjs/github-actions/.github/workflows/node-release.yml@v1
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
with:
checkTest: false
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
# egg-passport

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Node.js CI](https://github.com/eggjs/egg-passport/actions/workflows/nodejs.yml/badge.svg)](https://github.com/eggjs/egg-passport/actions/workflows/nodejs.yml)
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/egg-passport.svg?style=flat-square
[npm-url]: https://npmjs.org/package/egg-passport
[travis-image]: https://img.shields.io/travis/eggjs/egg-passport.svg?style=flat-square
[travis-url]: https://travis-ci.org/eggjs/egg-passport
[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/egg-passport.svg?style=flat-square
[codecov-url]: https://codecov.io/github/eggjs/egg-passport?branch=master
[david-image]: https://img.shields.io/david/eggjs/egg-passport.svg?style=flat-square
[david-url]: https://david-dm.org/eggjs/egg-passport
[snyk-image]: https://snyk.io/test/npm/egg-passport/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/egg-passport
[download-image]: https://img.shields.io/npm/dm/egg-passport.svg?style=flat-square
Expand Down
1 change: 1 addition & 0 deletions app/extend/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
/**
* Terminate an existing login session.
*
* @param {...any} args
* @api public
*/
logout(...args) {
Expand Down
3 changes: 3 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as Egg from 'egg';
import { Context, Request } from 'egg';

import { AuthenticateOptions, Strategy, Authenticator } from 'passport';
Expand Down Expand Up @@ -61,3 +62,5 @@ declare module 'egg' {
passportBitbucket?: EggPassportCommonConfig
}
}

export = Egg;
10 changes: 10 additions & 0 deletions index.test-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { expectType } from 'tsd';
import * as egg from '.';

const app = {} as egg.Application;
const ctx = {} as egg.Context;

expectType<boolean>(ctx.isAuthenticated());

// expectType<any>(app.passport.mount('foo'));
expectType<string>(app.config.passportLocal?.passwordField!);
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,34 @@
],
"dependencies": {
"@types/passport": "^1.0.11",
"debug": "^3.1.0",
"debug": "^4.3.4",
"passport": "^0.6.0"
},
"devDependencies": {
"autod": "^3.0.1",
"egg": "^2.0.0",
"egg-bin": "^4.3.7",
"egg-mock": "^3.14.0",
"egg": "^3.5.0",
"egg-bin": "^5.5.0",
"egg-mock": "^5.2.1",
"egg-passport-github": "*",
"egg-passport-twitter": "*",
"egg-passport-weibo": "*",
"egg-ts-helper": "^1.14.0",
"eslint": "^4.13.1",
"eslint-config-egg": "^5.1.1",
"egg-ts-helper": "^1.33.0",
"eslint": "^8.28.0",
"eslint-config-egg": "^12.1.0",
"passport-localapikey": "^0.0.3",
"runscript": "^1.3.0",
"typescript": "^3.1.6"
"runscript": "^1.5.3",
"tsd": "^0.25.0",
"typescript": "^4.9.3"
},
"engines": {
"node": ">=8.0.0"
"node": ">=14.19.0"
},
"scripts": {
"test": "npm run lint && npm run test-local",
"tsd": "tsd",
"test": "npm run lint && npm run tsd && npm run test-local",
"test-local": "egg-bin test",
"cov": "egg-bin cov",
"lint": "eslint config test lib app *.js",
"ci": "npm run lint && npm run cov",
"autod": "autod"
"lint": "eslint test lib app *.js",
"ci": "npm run lint && npm run tsd && npm run cov"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/app-ts/config/config.default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ export default (appInfo: EggAppInfo) => {
};

return config
}
}