authentication-method.entity.ts 685 B

1234567891011121314151617181920
  1. import { Entity, Index, ManyToOne, TableInheritance } from 'typeorm';
  2. import { VendureEntity } from '../base/base.entity';
  3. import { User } from '../user/user.entity';
  4. /**
  5. * @description
  6. * An AuthenticationMethod represents the means by which a {@link User} is authenticated. There are two kinds:
  7. * {@link NativeAuthenticationMethod} and {@link ExternalAuthenticationMethod}.
  8. *
  9. * @docsCategory entities
  10. * @docsPage AuthenticationMethod
  11. */
  12. @Entity()
  13. @TableInheritance({ column: { type: 'varchar', name: 'type' } })
  14. export abstract class AuthenticationMethod extends VendureEntity {
  15. @Index()
  16. @ManyToOne(type => User, user => user.authenticationMethods)
  17. user: User;
  18. }