authenticated-session.entity.ts 862 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { DeepPartial } from '@vendure/common/lib/shared-types';
  2. import { ChildEntity, Column, Index, ManyToOne } from 'typeorm';
  3. import { User } from '../user/user.entity';
  4. import { Session } from './session.entity';
  5. /**
  6. * @description
  7. * An AuthenticatedSession is created upon successful authentication.
  8. *
  9. * @docsCategory entities
  10. */
  11. @ChildEntity()
  12. export class AuthenticatedSession extends Session {
  13. constructor(input: DeepPartial<AuthenticatedSession>) {
  14. super(input);
  15. }
  16. /**
  17. * @description
  18. * The {@link User} who has authenticated to create this session.
  19. */
  20. @Index()
  21. @ManyToOne(type => User)
  22. user: User;
  23. /**
  24. * @description
  25. * The name of the {@link AuthenticationStrategy} used when authenticating
  26. * to create this session.
  27. */
  28. @Column()
  29. authenticationStrategy: string;
  30. }