import React from 'react' ; import FormLogin , { Props } from './FormLogin' ; const props = { title : 'Custom Title' , attempt : { isFailed : false , isSuccess : false , isProcessing : false , message : '' , } , authProviders : [ ] , onLoginWithSso : ( ) => null , onLoginWithU2f : ( ) => null , onLoginWithWebauthn : ( ) => null , onLogin : ( ) => null , clearAttempt : ( ) => null , auth2faType : 'off' , preferredMfaType : 'webauthn' , } ; export default { title : 'Teleport/FormLogin' , } ; export const Off = ( ) => < FormLogin { ... props } / > ; export const Otp = ( ) => < FormLogin { ... props } auth2faType = "otp" / > ; export const Webauthn = ( ) => < FormLogin { ... props } auth2faType = "webauthn" / > ; export const Universal2ndFactor = ( ) => { const attempt = { ... props . attempt , isProcessing : true , } ; return ( < FormLogin { ... props } title = "Welcome!" auth2faType = "u2f" attempt = { attempt } / > ) ; } ; export const Optional = ( ) => < FormLogin { ... props } auth2faType = "optional" / > ; export const Cloud = ( ) => ( < FormLogin { ... props } title = "Teleport Cloud" auth2faType = "on" isRecoveryEnabled = { true } onRecover = { ( ) => null } />); export const ServerError = ( ) => { const attempt = { ... props . attempt , isFailed : true , message : 'invalid credentials with looooooooooooooooooooooooooooooooong text' , } ; return < FormLogin { ... props } title = "Welcome!" attempt = { attempt } / > ; } ; export const SSOProviders = ( ) => { const ssoProvider = [ { displayName : 'github' , name : 'github' , type : 'oidc' , url : '' , } as const , { displayName : 'google' , name : 'google' , type : 'oidc' , url : '' , } as const , { displayName : 'bitbucket' , name : 'bitbucket' , type : 'oidc' , url : '' , } as const , { name : 'Mission Control' , type : 'oidc' , url : '' , } as const , { displayName : 'Microsoft' , name : 'microsoft' , type : 'oidc' , url : '' , } as const , ] ; return < FormLogin { ... props } title = "Welcome!" authProviders = { ssoProvider } / > ; } ; export const LocalAuthDisabled = ( ) => { const ssoProvider = [ { name : 'github' , type : 'oidc' , url : '' } as const , { name : 'google' , type : 'oidc' , url : '' } as const , ] ; return ( < FormLogin { ... props } title = "Welcome!" authProviders = { ssoProvider } isLocalAuthEnabled = { false } / > ) ; } ; export const LocalAuthDisabledNoSSO = ( ) => ( < FormLogin { ... props } title = "Welcome!" isLocalAuthEnabled = { false } / > ) ;