Skip to content

Commit

Permalink
fixup!: apply feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jannyHou committed Jan 23, 2019
1 parent fd906bb commit 58e0013
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/authentication-strategies/JWT.strategy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright IBM Corp. 2018, 2019. All Rights Reserved.
// Node module: @loopback4-example-shopping
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

const jwt = require('jsonwebtoken');
import {promisify} from 'util';
const verifyAsync = promisify(jwt.verify);
Expand Down
5 changes: 5 additions & 0 deletions src/authentication-strategies/authentication.strategy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright IBM Corp. 2018, 2019. All Rights Reserved.
// Node module: @loopback4-example-shopping
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

import {UserProfile} from '@loopback/authentication';
import {Request} from '@loopback/rest';

Expand Down
5 changes: 5 additions & 0 deletions src/providers/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
// Copyright IBM Corp. 2018, 2019. All Rights Reserved.
// Node module: @loopback4-example-shopping
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

export * from './strategy.resolver.provider';
export * from './custom.authentication.provider';
5 changes: 5 additions & 0 deletions src/providers/strategy.resolver.provider.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright IBM Corp. 2018. All Rights Reserved.
// Node module: @loopback4-example-shopping
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

import {Provider, ValueOrPromise} from '@loopback/core';
import {inject} from '@loopback/context';
import {
Expand Down
5 changes: 5 additions & 0 deletions src/utils/user.authentication.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright IBM Corp. 2018, 2019. All Rights Reserved.
// Node module: @loopback4-example-shopping
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

import * as _ from 'lodash';
import {Credentials, UserRepository} from '../repositories/user.repository';
import {toJSON} from '@loopback/testlab';
Expand Down
5 changes: 5 additions & 0 deletions test/acceptance/helper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright IBM Corp. 2018, 2019. All Rights Reserved.
// Node module: @loopback4-example-shopping
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

import {ShoppingApplication} from '../..';
import {
createRestAppClient,
Expand Down
2 changes: 2 additions & 0 deletions test/acceptance/user.controller.acceptance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ describe('UserController', () => {
});

describe('authentication functions', () => {
// TODO: fix storing the plain password in the following issue:
// https://github.com/strongloop/loopback-next/issues/1996
it('login returns a valid token', async () => {
const newUser = await userRepo.create(user);
await client
Expand Down

0 comments on commit 58e0013

Please sign in to comment.