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

When using sign in for the first time, always facing a Uncaught runtime error #240

Open
piyumaldk opened this issue Aug 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@piyumaldk
Copy link

Describe the issue:
When using sign in for the first time, always facing a Uncaught runtime error.
image

Console log
image

However, weirdly this issue is not reproduced if we have refreshed the page.

How to reproduce:
Used a simple sign in button such as below are try.

import React from 'react';
import { useAuthContext } from "@asgardeo/auth-react";

const SignIn = () => {
    const { state, signIn } = useAuthContext();

    if (state.isLoading) {
        return (
          <h1>Loading</h1>
        );
    }

    return (
        <>
            <h1>AI Subscription Login Page</h1>
            <button onClick={ () => signIn() }>Login</button>
        </>
    );
};

export default SignIn;

Expected behavior:
Redirecting to the login page of Asgardeo without an issue.

Environment information (Please complete the following information; remove any unnecessary fields) :

  • Product Version: @asgardeo/auth-react: "^5.1.1"
  • OS: Mac
  • Database: N/A
  • Userstore: N/A
@piyumaldk piyumaldk added the bug Something isn't working label Aug 1, 2024
@brionmario
Copy link
Member

Hi @piyumaldk,

Could you please share the SDK configuration (clientId and any other sensitive data redacted) you are using in the application.

@NipuniBhagya
Copy link
Contributor

Hi @piyumaldk,

Could you please share the SDK configuration (clientId and any other sensitive data redacted) you are using in the application.

Also, how do you maintain the SDK configurations? (ex: .env, .json or in the index.jsx/main.jsx)

@pavinduLakshan
Copy link
Contributor

This is still reproducible when trying to integrate the SDK with a simple vite React app.

Screenshot 2024-09-09 at 05 40 49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants