diff --git a/docs/Dockerfile b/docs/Dockerfile new file mode 100644 index 0000000..fc8b807 --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,4 @@ +FROM joseluisq/static-web-server:2 + +COPY ./www /public + diff --git a/package.json b/package.json index 04fb8e3..e27e1dc 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "app": "tsc && node lib/index.js", "prepare": "pnpm run build", "docs:build": "typedoc --options typedoc.json", + "docs:build:docker": "pnpm run docs:build && docker image build docs -t ${DOCKER_REGISTRY}/extollo/docs:latest && docker push ${DOCKER_REGISTRY}/extollo/docs:latest", "lint": "eslint . --ext .ts", "lint:fix": "eslint --fix . --ext .ts" }, diff --git a/src/auth/provider/oauth/CoreIDLoginProvider.ts b/src/auth/provider/oauth/CoreIDLoginProvider.ts index 0e2f87d..dd8f29b 100644 --- a/src/auth/provider/oauth/CoreIDLoginProvider.ts +++ b/src/auth/provider/oauth/CoreIDLoginProvider.ts @@ -11,12 +11,7 @@ import {ErrorWithContext, uuid4, fetch} from '../../../util' export class CoreIDLoginProvider extends OAuth2LoginProvider { protected async callback(request: Request): Promise { // Get authentication_code from the request - const code = String(request.input('code') || '') - if ( !code ) { - throw new ErrorWithContext('Unable to authenticate user: missing login code', { - input: request.input(), - }) - } + const code = request.safe('code').string() // Get OAuth2 token from CoreID const token = await this.getToken(code)