Skip to content

Indicate when temporary password is expired #9844

Open
@ghost

Description

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

Authentication, REST API

Amplify Categories

auth

Environment information

NA

Describe the bug

No clear response from Cognito for temporary password expiration vs invalid username/password. Currently when a user tries to login with a temporary password that is no longer valid the response is NotAuthorizedException. This is the same response for invalid email / password. If we are to set any conditional logic for actions to be taken in either scenario or custom messages to be displayed to the user there needs to be some sort of error code or difference for the developer to use.
We have tried setting pre and post authorization hooks within lamda functions, but that will not work as the pre auth is not yet aware the temp password has expired and post auth will never be called because the auth is unsuccessful. Im aware that there is an issue #1182 however this does not fully resolve the problem.

Expected behavior

When a user attempts to login with an expired temporary password I expect a unique error response

Reproduction steps

  1. create user with adminCreateUser
  2. new user attempts to login with temporary password that has expired

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

Metadata

Metadata

Assignees

Labels

AuthRelated to Auth components/categoryCognitoRelated to cognito issuesService TeamIssues asked to the Service Teamfeature-requestRequest a new feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions