fossasia / susi_android

SUSI.AI Android App https://play.google.com/apps/testing/ai.susi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No new Signup

rahulpansari opened this issue · comments

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

@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.

@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.

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.

	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

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.

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

Maybe because captcha code is not sent with signup

@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.

Okay, I am on it.

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.

Then show the dependency you are using

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

and

safetynetVersion = "17.0.0"

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

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

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

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.

What is the response code

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.

What is the response code

I am getting 422.

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

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

Okay

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

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

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

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