You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 24, 2018. It is now read-only.
I am trying to implement custom authentication flow and as per the use case 25, I am trying to call initiateAuth method.(Please note that I am using JS SDK version 1.28.0 which is latest).The problem here is initiateAuth method is not available on cognitoUser. You can find it below?
declare module "amazon-cognito-identity-js" {
import * as AWS from "aws-sdk";
export type NodeCallback<E,T> = (err?: E, result?: T) => void;
export class CognitoUserAttribute {
constructor(data: ICognitoUserAttributeData);
public getValue(): string;
public setValue(value: string): CognitoUserAttribute;
public getName(): string;
public setName(name: string): CognitoUserAttribute;
public toString(): string;
public toJSON(): Object;
export class CognitoUserSession {
constructor(data: ICognitoUserSessionData);
public getIdToken(): CognitoIdToken;
public getRefreshToken(): CognitoRefreshToken;
public getAccessToken(): CognitoAccessToken;
public isValid(): boolean;
}
export class CognitoIdentityServiceProvider {
public config: AWS.CognitoIdentityServiceProvider.Types.ClientConfiguration;
}
Yes, I explained the typescript definition for that is missing as the definitions are community maintained. I will make a note to add the typescript definition for initiateAuth.
I am trying to implement custom authentication flow and as per the use case 25, I am trying to call initiateAuth method.(Please note that I am using JS SDK version 1.28.0 which is latest).The problem here is initiateAuth method is not available on cognitoUser. You can find it below?
import * as AWS from "aws-sdk";
export type NodeCallback<E,T> = (err?: E, result?: T) => void;
export interface IAuthenticationDetailsData {
Username: string;
Password: string;
}
export class AuthenticationDetails {
constructor(data: IAuthenticationDetailsData);
}
export interface ICognitoStorage {
setItem(key: string, value: string): void;
getItem(key: string): string;
removeItem(key: string): void;
clear(): void;
}
export interface ICognitoUserData {
Username: string;
Pool: CognitoUserPool;
Storage?: ICognitoStorage;
}
export class CognitoUser {
constructor(data: ICognitoUserData);
}
export interface MFAOption {
DeliveryMedium: "SMS" |"EMAIL";
AttributeName: string;
}
export interface ICognitoUserAttributeData {
Name: string;
Value: string;
}
export class CognitoUserAttribute {
constructor(data: ICognitoUserAttributeData);
}
export interface ISignUpResult {
user: CognitoUser;
userConfirmed: boolean;
userSub: string;
}
export interface ICognitoUserPoolData {
UserPoolId: string;
ClientId: string;
endpoint?: string;
Storage?: ICognitoStorage;
}
export class CognitoUserPool {
constructor(data: ICognitoUserPoolData);
}
export interface ICognitoUserSessionData {
IdToken: CognitoIdToken;
AccessToken: CognitoAccessToken;
RefreshToken?: CognitoRefreshToken;
}
export class CognitoUserSession {
constructor(data: ICognitoUserSessionData);
}
export class CognitoIdentityServiceProvider {
public config: AWS.CognitoIdentityServiceProvider.Types.ClientConfiguration;
}
export class CognitoAccessToken {
constructor({ AccessToken }: { AccessToken: string });
}
export class CognitoIdToken {
constructor({ IdToken }: { IdToken: string });
}
export class CognitoRefreshToken {
constructor({ RefreshToken }: { RefreshToken: string });
}
export interface ICookieStorageData {
domain: string;
path?: string;
expires?: number;
secure?: boolean;
}
export class CookieStorage implements ICognitoStorage {
constructor(data: ICookieStorageData);
setItem(key: string, value: string): void;
getItem(key: string): string;
removeItem(key: string): void;
clear(): void;
}
}
Am I missing something here? Can somebody please help me.
The text was updated successfully, but these errors were encountered: