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

No new Signup #2367

Open
rahulpansari opened this issue Aug 28, 2019 · 27 comments
Open

No new Signup #2367

rahulpansari opened this issue Aug 28, 2019 · 27 comments

Comments

@rahulpansari
Copy link

when i try to login with my email id it pop up email id not registered

and in signup option it pop up as email already registered click on forgot password to continue

again in forgot password email is is not registered

@atm1504
Copy link
Member

atm1504 commented Aug 28, 2019

@rahulpansari check you must have received san email with an activation link. You need to activate your account by clicking on the link before trying to log in.

@atm1504
Copy link
Member

atm1504 commented Sep 16, 2019

@rahulpansari try to sign in using the web client and see if same problem arises or not.
If it exists, then it's the problem of server. Also, try to signup with a different email id in the web client and then login in the app.

@Zyro9922
Copy link
Member

Yes. We cannot log in through the app. If an email-ID is registered through susi.ai Web Client then login is successful. But if we try to register through app registration is not successful and we get an error message that "E-mail already exists". As Web Client is working fine there is something wrong on the Android Side. I want to take responsibility for solving this issue.

@Zyro9922
Copy link
Member

Zyro9922 commented Sep 17, 2019

	override fun onSuccess(response: Response<SignUpResponse>) {
        signUpView?.showProgress(false)
        if (response.isSuccessful && response.body() != null) {
            signUpView?.alertSuccess()
            signUpView?.clearField()
        } else { `
            **if (response.code() == 422)** `{
                signUpView?.alertFailure()
            } else {
                signUpView?.onSignUpError("${response.code()} " + utilModel.getString(R.string.error), response.message())
            }
        }
        signUpView?.showProgress(false)
    }

For any new email id

	@POST("/aaa/signup.json")
    fun signUp(
        @Query("signup") email: String,
        @Query("password") password: String
    ): Call<SignUpResponse>

This is returning response 422. Code is handling it by the logic that if response is 422 show a dialog box that email is already registered. So can someone verify what is wrong at the endpoint "/aaa/signup.json" as it should return success after providing new email id

@Zyro9922
Copy link
Member

In listener.onLoginModelSuccess(response) after providing a new email ID, password it is throwing response 401 which is handled by logic as Showing Email not registered.

@Zyro9922
Copy link
Member

Can someone check why the response is 401 when registering with a new email ID?

@iamareebjamal
Copy link
Member

Maybe because captcha code is not sent with signup

@atm1504
Copy link
Member

atm1504 commented Sep 18, 2019

@Zyro9922 this is because of re-captcha. A pr by me is open for that. Take help from that pr for Recaptcha. First, add the ReCaptcha. Then try to signup, it will work. Please fix it soon.

@atm1504
Copy link
Member

atm1504 commented Sep 18, 2019

@Zyro9922
Copy link
Member

Okay, I am on it.

@Zyro9922
Copy link
Member

Zyro9922 commented Sep 19, 2019

At present, I have added a checkbox in signUp page. When the user checks it, the Recaptcha validation is started. If a user is validated then the userResponseToken is stored else if there is any issue in validating, the checkbox is unchecked and he/she has to try again.

Next, I have to send the userResponseToken using the @query("g-recaptcha-response") recaptchaResponse: String

After making some changes I am getting this error. How to solve it?

Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
	is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
	Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:11:5-57:19 to override.

I am getting this error only after adding the dependency for reCAPTCHA.

@iamareebjamal
Copy link
Member

Then show the dependency you are using

@Zyro9922
Copy link
Member

implementation "com.google.android.gms:play-services-safetynet:${rootConfiguration.safetynetVersion}"

and

safetynetVersion = "17.0.0"

@iamareebjamal
Copy link
Member

iamareebjamal commented Sep 19, 2019

Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:11:5-57:19 to override

@Zyro9922
Copy link
Member

Tried this. Still not working. I think as I am using

implementation "com.google.android.gms:play-services-safetynet:${rootConfiguration.safetynetVersion}"

which is a google dependency so it wants the app to be migrated to AndroidX. I read some threads where doing this solved the issue.

image

@atm1504
Copy link
Member

atm1504 commented Sep 19, 2019

@Zyro9922 please have a look here. This issue was solved here:
#2349

@Zyro9922
Copy link
Member

Zyro9922 commented Sep 20, 2019

I understood the issue. We get this issue only when we use version 17.0.0 of SafetyNet. I used 16.0.0 as at #2349 and it works fine.

At present I have

  1. Updated Layout for Recaptcha
  2. Added validation check
  3. Generating userResponseToken
  4. Passing it to sign up as
@POST("/aaa/signup.json")
    fun signUp(
        @Query("signup") email: String,
        @Query("g-recaptcha-response") recaptcha_response: String,
        @Query("password") password: String
    ): Call<SignUpResponse>

Still, I am not able to sign up.

@iamareebjamal
Copy link
Member

What is the response code

@atm1504
Copy link
Member

atm1504 commented Sep 20, 2019

I understood the issue. We get this issue only when we use version 17.0.0 of SafetyNet. I used 16.0.0 as at #2349 and it works fine.

Yes, I remembered. I also faced a similar case. The issue got resolved after downgrading the version of SafetyNet. Even google search revealed the same solution.

@Zyro9922
Copy link
Member

What is the response code

I am getting 422.

@atm1504
Copy link
Member

atm1504 commented Sep 20, 2019

https://github.com/fossasia/susi_server/blob/ccf63b3caffc6340ca954dbd392655807c6041ca/src/ai/susi/server/api/aaa/SignUpService.java#L202

Reveals that the ReCaptcha is failing to be verified. Please check if you are sending the correct g-recaptcha-response value as aparameter or not

GitHub
SUSI.AI server backend - the Artificial Intelligence server for personal assistants https://api.susi.ai - fossasia/susi_server

@iamareebjamal
Copy link
Member

Well, for recaptcha, you need the same key used in server AFAIK. I dn't know how are new developers supposed to work around that. Open an issue on server

@Zyro9922
Copy link
Member

Okay

@Skrilltrax
Copy link

Instead of using reCaptcha can't we use email/sms verification, reCaptcha isn't a common UI flow in android apps.

@atm1504
Copy link
Member

atm1504 commented Sep 21, 2019

@Skrilltrax email verification is already present. ReCaptcha was added as a special check by the server people..

@explorigin
Copy link

Related: fossasia/susi.ai#3564 (I'm also seeing this issue, kinda crazy that it's been going on for more than a year.)

@iamareebjamal
Copy link
Member

I recommend to just disable recaptcha as it was implemented without notifying the mobile devs or considering backward compatibility. It doesn't solve any problem on mobile at least, and makes the mobile app use and also apparently, is causing inconvenience on web as well. If actions are restricted to verified accounts, the bot problem which captcha service is supposed to solve will automatically be resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants