Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/release 2 #27

Merged
merged 43 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
48e677c
[signup] Added support for signup screen functionality
gyaneshgouraw-okta Jan 20, 2025
7aa74b3
[login] Added support for login screen functionality
gyaneshgouraw-okta Jan 20, 2025
9cfb8d7
[reset-password-email] Added support for reset-password-email screen
nandan-bhat Jan 20, 2025
07d8fa5
[reset-password-request] Added support for reset-password-request screen
nandan-bhat Jan 20, 2025
fe4d01f
[reset-password] Added support for reset-password screen
nandan-bhat Jan 20, 2025
77f5966
[reset-password-error] Added support for reset-password-error screen
nandan-bhat Jan 20, 2025
d664a4d
[reset-password-success] Added support for reset-password-success screen
nandan-bhat Jan 20, 2025
f47d008
Updating the partial export section
nandan-bhat Jan 21, 2025
6458b88
Correcting exports
nandan-bhat Jan 22, 2025
7d773dc
[signup] Added missing socialSignup handler
nandan-bhat Jan 23, 2025
82fa7b3
Added support for reset-password-request screen
gyaneshgouraw-okta Jan 24, 2025
58e8abe
chore: updated FAQ to reset-password-email screen
gyaneshgouraw-okta Jan 27, 2025
d63ea55
[BugFix] Handle when context object doesn't contain organization key …
nandan-bhat Jan 28, 2025
6f78b2e
[BugFix] Fix reset-password code samples
nandan-bhat Jan 28, 2025
997ab46
Updated reset-password-request to include allowed identifers
gyaneshgouraw-okta Jan 28, 2025
6971d26
[enhancement] Adding missing properties. Updating the interfaces
nandan-bhat Jan 28, 2025
22ac6a2
Merge branch 'feature/release-2' of https://github.com/auth0/universa…
nandan-bhat Jan 28, 2025
2a65f7d
[bugfix] Fixing reset-password.md
nandan-bhat Jan 28, 2025
db4f385
Updated example code snippet for reset-password-request screen
gyaneshgouraw-okta Jan 28, 2025
ab867ba
Updated reset-password-request example.md file
gyaneshgouraw-okta Jan 28, 2025
2be2504
Updated readme.md and FAQ with new screen details
gyaneshgouraw-okta Jan 28, 2025
87e5a5c
Making changes as per the changes in the RFC
nandan-bhat Feb 4, 2025
c6c859d
Added non-flexible identifier check for reset-password-request primar…
gyaneshgouraw-okta Feb 5, 2025
e26709d
Added changelog and updated availablity of hasFlexibleIdentifer
gyaneshgouraw-okta Feb 5, 2025
33359c9
Added missing type definitions to docs
gyaneshgouraw-okta Feb 5, 2025
f196a8d
Fixed lint related errors
gyaneshgouraw-okta Feb 5, 2025
f272dc0
Removed redndant interfaces from reset-password-request
gyaneshgouraw-okta Feb 5, 2025
56e5487
Fixed unit test for reset-password-request screen
gyaneshgouraw-okta Feb 5, 2025
4c0dc11
✅ Fix: Added unit tests for browser-capabilities.ts and form-handler.ts
nandan-bhat Feb 5, 2025
8101869
Merge branch 'feature/release-2' of https://github.com/auth0/universa…
nandan-bhat Feb 5, 2025
32b16ef
Removed unwanted console.logs
nandan-bhat Feb 5, 2025
e2af7fc
Added tests for utils/passkeys.ts
nandan-bhat Feb 5, 2025
ecd3002
Added unit tests for utils/codec
nandan-bhat Feb 5, 2025
5b18371
Increasing the code coverage in utils/form-handler
nandan-bhat Feb 5, 2025
bae5552
Restructuring the unit test files to accomodate override test files
nandan-bhat Feb 5, 2025
3df4013
Added missing unit tests
nandan-bhat Feb 5, 2025
3f78786
Adding more unit tests
nandan-bhat Feb 5, 2025
8299667
Exporting all interfaces available in the API docs
nandan-bhat Feb 6, 2025
e855be3
Fix loginLink issue on signup screen
nandan-bhat Feb 6, 2025
63b4e91
Removed un-used properties
nandan-bhat Feb 6, 2025
6663af6
Updated release-2 changelog with breaking change
gyaneshgouraw-okta Feb 6, 2025
b4a4f5a
Fixing interfaces
nandan-bhat Feb 6, 2025
39e4cad
Merge branch 'feature/release-2' of https://github.com/auth0/universa…
nandan-bhat Feb 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/auth0-acul-js/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@
"singleQuote": true
}
],
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/no-unsafe-member-access": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/no-unsafe-assignment": "error",
Expand Down
49 changes: 49 additions & 0 deletions packages/auth0-acul-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

## [[email protected]](https://github.com/auth0/auth0-react/tree/v0.1.0) (2024-02-06)

**Added**

Support for the following screens:

1. [login](https://auth0.github.io/universal-login/classes/Classes.Login.html)
2. [signup](https://auth0.github.io/universal-login/classes/Classes.Signup.html)
3. [reset-password-email](https://auth0.github.io/universal-login/classes/Classes.ResetPasswordEmail.html)
4. [reset-password-request](https://auth0.github.io/universal-login/classes/Classes.ResetPasswordRequest.html)
5. [reset-password](https://auth0.github.io/universal-login/classes/Classes.ResetPassword.html)
6. [reset-password-error](https://auth0.github.io/universal-login/classes/Classes.ResetPasswordError.html)
7. [reset-password-success](https://auth0.github.io/universal-login/classes/Classes.ResetPasswordSuccess.html)

**Breaking Changes**

- **Flattened Screen-Related Properties**: We have simplified the structure of screen-related properties by removing the methods and replacing them with direct properties.

Example:
- The previous `loginIdInstance.transaction.geErrors` method has been replaced with the new `loginIdInstance.transaction.errors` property.

**Code Example:**
```javascript
import LoginId from "@auth0/auth0-acul-js/login-id";
const loginIdManager = new LoginId();
// Old method
loginIdInstance.transaction.geErrors();
// New property
loginIdInstance.transaction.errors;

## [[email protected]](https://github.com/auth0/auth0-react/tree/v0.1.0) (2024-12-09)

**Added**

Support for the following screens:

1. [login-id](https://auth0.github.io/universal-login/classes/Classes.LoginId.html)
2. [login-Password](https://auth0.github.io/universal-login/classes/Classes.LoginPassword.html)
3. [signup-id](https://auth0.github.io/universal-login/classes/Classes.SignupId.html)
4. [signup-password](https://auth0.github.io/universal-login/classes/Classes.SignupPassword.html)
5. [login-passwordless-email-code](https://auth0.github.io/universal-login/classes/Classes.LoginPasswordlessEmailCode.html)
6. [login-passwordless-sms-otp](https://auth0.github.io/universal-login/classes/Classes.LoginPasswordlessSmsOtp.html)
7. [passkey-enrollment](https://auth0.github.io/universal-login/classes/Classes.PasskeyEnrollment.html)
8. [passkey-enrollment-local](https://auth0.github.io/universal-login/classes/Classes.PasskeyEnrollmentLocal.html)
9. [phone-identifier-enrollment](https://auth0.github.io/universal-login/classes/Classes.PhoneIdentifierEnrollment.html)
10. [phone-identifier-challenge](https://auth0.github.io/universal-login/classes/Classes.PhoneIdentifierChallenge.html)
11. [email-identifier-challenge](https://auth0.github.io/universal-login/classes/Classes.EmailIdentifierChallenge.html)
12. [interstitial-captcha](https://auth0.github.io/universal-login/classes/Classes.InterstitialCaptcha.html)
9 changes: 8 additions & 1 deletion packages/auth0-acul-js/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ import PhoneIdentifierChallengeScreen from '@auth0/auth0-acul-js/phone-identif
import PhoneIdentifierEnrolmentScreen from '@auth0/auth0-acul-js/phone-identifier-enrollment';
import EmailIdentifierChallengeScreen from '@auth0/auth0-acul-js/email-identifier-challenge';
import InterstitialCaptchaScreen from '@auth0/auth0-acul-js/interstitial-captcha';
import Login from '@auth0/auth0-acul-js/login';
import Signup from '@auth0/auth0-acul-js/signup';
import ResetPassword from '@auth0/auth0-acul-js/reset-password';
import ResetPasswordRequest from '@auth0/auth0-acul-js/reset-password-request';
import ResetPasswordEmail from '@auth0/auth0-acul-js/reset-password-email';
import ResetPasswordSuccess from '@auth0/auth0-acul-js/reset-password-success';
import ResetPasswordError from '@auth0/auth0-acul-js/reset-password-error';

```

Expand All @@ -28,7 +35,7 @@ import InterstitialCaptchaScreen from '@auth0/auth0-acul-js/interstitial-captc
The SDK provides multiple ways to detect and view errors during the process:

1. **Screen-Specific Errors**
Each screen includes a `transaction.getErrors()` method, which returns a list of errors specific to that screen. These errors are generated after the final validation of the request, helping you identify issues that need attention.
Each screen includes a `transaction.errors` property, which returns a list of errors specific to that screen. These errors are generated after the final validation of the request, helping you identify issues that need attention.

2. **Submit Handler Errors**
The SDK may throw errors if invalid parameters are passed to the submit handler. These errors occur when validation fails and can be caught during the submission process.
Expand Down
36 changes: 21 additions & 15 deletions packages/auth0-acul-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Let’s look at an example for adding logic to the `login-id` screen.

// Trigger the login method on button click
loginIdManager.login({
username: <USERNAME_FIELD_VALUE>
username: "testUser"
});
```

Expand Down Expand Up @@ -111,7 +111,7 @@ const selectedConnection = alternateConnections[0];
console.log(`Selected connection: ${selectedConnection.name}`);

// Proceed with social login using the selected connection
loginIdManager.continueWithFederatedLogin({
loginIdManager.socialLogin({
connection: selectedConnection.name,
})
```
Expand All @@ -123,28 +123,34 @@ Get up and running quickly with our boilerplate starter template: [Link](https:/
## API reference
### Screens

1. [login-id](https://auth0.github.io/universal-login/classes/Classes.LoginId.html)
2. [login-Password](https://auth0.github.io/universal-login/classes/Classes.LoginPassword.html)
3. [signup-id](https://auth0.github.io/universal-login/classes/Classes.SignupId.html)
4. [signup-password](https://auth0.github.io/universal-login/classes/Classes.SignupPassword.html)
1. [login](https://auth0.github.io/universal-login/classes/Classes.Login.html)
2. [login-id](https://auth0.github.io/universal-login/classes/Classes.LoginId.html)
3. [login-Password](https://auth0.github.io/universal-login/classes/Classes.LoginPassword.html)
4. [signup-id](https://auth0.github.io/universal-login/classes/Classes.SignupId.html)
5. [signup-password](https://auth0.github.io/universal-login/classes/Classes.SignupPassword.html)
<details>
<summary>Explore more screens...</summary>

5. [login-passwordless-email-code](https://auth0.github.io/universal-login/classes/Classes.LoginPasswordlessEmailCode.html)
6. [login-passwordless-sms-otp](https://auth0.github.io/universal-login/classes/Classes.LoginPasswordlessSmsOtp.html)
7. [passkey-enrollment](https://auth0.github.io/universal-login/classes/Classes.PasskeyEnrollment.html)
8. [passkey-enrollment-local](https://auth0.github.io/universal-login/classes/Classes.PasskeyEnrollmentLocal.html)
9. [phone-identifier-enrollment](https://auth0.github.io/universal-login/classes/Classes.PhoneIdentifierEnrollment.html)
10. [phone-identifier-challenge](https://auth0.github.io/universal-login/classes/Classes.PhoneIdentifierChallenge.html)
11. [email-identifier-challenge](https://auth0.github.io/universal-login/classes/Classes.EmailIdentifierChallenge.html)
12. [interstitial-captcha](https://auth0.github.io/universal-login/classes/Classes.InterstitialCaptcha.html)
6. [login-passwordless-email-code](https://auth0.github.io/universal-login/classes/Classes.LoginPasswordlessEmailCode.html)
7. [login-passwordless-sms-otp](https://auth0.github.io/universal-login/classes/Classes.LoginPasswordlessSmsOtp.html)
8. [passkey-enrollment](https://auth0.github.io/universal-login/classes/Classes.PasskeyEnrollment.html)
9. [passkey-enrollment-local](https://auth0.github.io/universal-login/classes/Classes.PasskeyEnrollmentLocal.html)
10. [phone-identifier-enrollment](https://auth0.github.io/universal-login/classes/Classes.PhoneIdentifierEnrollment.html)
11. [phone-identifier-challenge](https://auth0.github.io/universal-login/classes/Classes.PhoneIdentifierChallenge.html)
12. [email-identifier-challenge](https://auth0.github.io/universal-login/classes/Classes.EmailIdentifierChallenge.html)
13. [interstitial-captcha](https://auth0.github.io/universal-login/classes/Classes.InterstitialCaptcha.html)
14. [reset-password-email](https://auth0.github.io/universal-login/classes/Classes.ResetPasswordEmail.html)
15. [reset-password-request](https://auth0.github.io/universal-login/classes/Classes.ResetPasswordRequest.html)
16. [reset-password](https://auth0.github.io/universal-login/classes/Classes.ResetPassword.html)
17. [reset-password-error](https://auth0.github.io/universal-login/classes/Classes.ResetPasswordError.html)
18. [reset-password-success](https://auth0.github.io/universal-login/classes/Classes.ResetPasswordSuccess.html)
19. [signup](https://auth0.github.io/universal-login/classes/Classes.Signup.html)
</details>






## Feedback

### Contributing
Expand Down
174 changes: 174 additions & 0 deletions packages/auth0-acul-js/examples/login.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# Login Screen Examples

## Basic Login with Username/Password

```typescript
import Login from '@auth0/auth0-acul-js/login';

const loginManager = new Login();

// Handle form submission
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();

try {
await loginManager.login({
username: '[email protected]',
password: 'myPassword123'
});
} catch (error) {
console.error('Login failed:', error);
}
};
```

## Login with Social Provider

```typescript
import Login from '@auth0/auth0-acul-js/login';

const loginManager = new Login();

// Handle social login
const handleSocialLogin = async (connection: string) => {
try {
await loginManager.socialLogin({
connection: connection // e.g. 'google-oauth2'
});
} catch (error) {
console.error('Social login failed:', error);
}
};
```

## React Component Example with TailwindCSS

```tsx
import React, { useState } from 'react';
import Login from '@auth0/auth0-acul-js/login';

const LoginScreen: React.FC = () => {
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const [error, setError] = useState('');

const loginManager = new Login();
const { transaction } = loginManager;

const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setError('');

try {
await loginManager.login({
username,
password
});
} catch (error) {
setError('Login failed. Please check your credentials.');
}
};

const handleSocialLogin = async (connection: string) => {
try {
await loginManager.socialLogin({ connection });
} catch (error) {
setError('Social login failed. Please try again.');
}
};

return (
<div className="min-h-screen bg-gray-100 flex flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="sm:mx-auto sm:w-full sm:max-w-md">
<h2 className="mt-6 text-center text-3xl font-extrabold text-gray-900">
Sign in to your account
</h2>
</div>

<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div className="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
<form className="space-y-6" onSubmit={handleSubmit}>
<div>
<label htmlFor="username" className="block text-sm font-medium text-gray-700">
Username or Email
</label>
<div className="mt-1">
<input
id="username"
name="username"
type="text"
required
value={username}
onChange={(e) => setUsername(e.target.value)}
className="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500"
/>
</div>
</div>

<div>
<label htmlFor="password" className="block text-sm font-medium text-gray-700">
Password
</label>
<div className="mt-1">
<input
id="password"
name="password"
type="password"
required
value={password}
onChange={(e) => setPassword(e.target.value)}
className="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500"
/>
</div>
</div>

{error && (
<div className="text-red-600 text-sm">
{error}
</div>
)}

<div>
<button
type="submit"
className="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
>
Sign in
</button>
</div>
</form>

{transaction.alternateConnections && transaction.alternateConnections.length > 0 && (
<div className="mt-6">
<div className="relative">
<div className="absolute inset-0 flex items-center">
<div className="w-full border-t border-gray-300" />
</div>
<div className="relative flex justify-center text-sm">
<span className="px-2 bg-white text-gray-500">
Or continue with
</span>
</div>
</div>

<div className="mt-6 grid grid-cols-3 gap-3">
{transaction.alternateConnections.map((connection) => (
<button
key={connection.name}
onClick={() => handleSocialLogin(connection.name)}
className="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"
>
{connection.name}
</button>
))}
</div>
</div>
)}
</div>
</div>
</div>
);
};

export default LoginScreen;
```
5 changes: 5 additions & 0 deletions packages/auth0-acul-js/examples/reset-password-email.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import ResetPasswordEmail from '@auth0/auth0-acul-js/reset-password-email';

const resetPasswordEmail = new ResetPasswordEmail();

resetPasswordEmail.resendEmail();
8 changes: 8 additions & 0 deletions packages/auth0-acul-js/examples/reset-password-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import ResetPasswordError from '@auth0/auth0-acul-js/reset-password-error';

const resetPasswordError = new ResetPasswordError();

const { screen } = resetPasswordError;
const data = screen.data;

console.log(data);
Loading