appwrite icon indicating copy to clipboard operation
appwrite copied to clipboard

šŸ› Bug Report: accounts.create does not get trigger function on account created with OAuth provider

Open matfire opened this issue 4 years ago • 21 comments
trafficstars

šŸ‘Ÿ Reproduction steps

  • Create a function that should get triggered on accounts.create
  • Deploy tag (my use case was creating a document in a collection)
  • Create an account with email and password from a web frontend (React in my specific case)
  • Function should get triggered
  • Create another account using an Oauth provider (Google in my case)
  • Function should not get triggered

šŸ‘ Expected behavior

Function should get triggered in both cases, when an account is created using email + password and when using a third party provider (Google, Github etc)

šŸ‘Ž Actual Behavior

Function gets triggered only when creating an account using email and password

šŸŽ² Appwrite version

Different version (specify in environment)

šŸ’» Operating system

Linux

🧱 Your Environment

Appwrite v:0.11.0.170

šŸ‘€ Have you spent some time to check if this issue has been raised before?

  • [X] I checked and didn't find similar issue

šŸ¢ Have you read the Code of Conduct?

matfire avatar Nov 11 '21 11:11 matfire

I’m also having the same issue.

JaviBonilla avatar Nov 13 '21 16:11 JaviBonilla

I'm on the case šŸ‘

PineappleIOnic avatar Nov 15 '21 09:11 PineappleIOnic

Is this issue solved in 13.4 or it is still there? Last I checked it was there in 12.x versions

garvitomer avatar May 01 '22 16:05 garvitomer

@TorstenDittmann Was this fixed in 0.14 with the new Event model?

PineappleIOnic avatar Jun 21 '22 08:06 PineappleIOnic

@PineappleIOnic, looking at the code, it looks like the user is created, but no new user event is triggered:

https://github.com/appwrite/appwrite/blob/648b6f2038fb59b2beb78d81cea08aa730a106c3/app/controllers/api/account.php#L466-L501

stnguyen90 avatar Jul 12 '22 00:07 stnguyen90

I think this issue also exists when creating a user using Magic URL

karniv00l avatar Jul 20 '22 17:07 karniv00l

@stnguyen90 , can this be prioritized higher?

I see this has been lagging since 0.16 milestone but currently this bug prevents me from using Google OAuth2 in my app.

Thank you!

ddenev avatar Oct 09 '22 08:10 ddenev

Use 'session.create' for time being, I am also using the same.

On Sun, 9 Oct, 2022, 1:58 pm Dragomir Denev, @.***> wrote:

@stnguyen90 https://github.com/stnguyen90 , can this be prioritized higher?

I see this has been lagging since 0.16 milestone but currently this bug prevents me from using Google OAuth2 in my app.

Thank you!

— Reply to this email directly, view it on GitHub https://github.com/appwrite/appwrite/issues/2406#issuecomment-1272487880, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASHUZ2C6FON4AKHHFK5ULULWCJ62NANCNFSM5H2GGTHA . You are receiving this because you commented.Message ID: @.***>

garvitomer avatar Oct 09 '22 08:10 garvitomer

Still an issue with Magic URLs. Checking for session creation with some sort of state is possible but not ideal.

t0mm4rx avatar Jun 28 '23 20:06 t0mm4rx

What is the status for this issue?

moshOntong-IT avatar Aug 10 '23 13:08 moshOntong-IT

We should consider introducing a new method named createOAuth2.

The primary objective of this method is to facilitate sign-up using an OAuth2 provider. When this method is invoked, the backend will recognize the user as a new one, subsequently triggering the appropriate event.

On the other hand, the existing method, createOAuth2Session, is solely for signing in or establishing a session with the OAuth provider. If the account does not exist, it should return a "404 Not Found" error, rather than automatically creating a new account.

moshOntong-IT avatar Aug 28 '23 00:08 moshOntong-IT

Hey, what's the status of this issue?

PratikDev avatar Sep 22 '23 21:09 PratikDev

Also checking in on the status so that we can implement Google oauth. Is there a work around at the moment?

tdansie avatar Sep 30 '23 15:09 tdansie

Subscribing to this.

ItzNotABug avatar Oct 11 '23 05:10 ItzNotABug

Hey, is it fixed in 1.5?

limes avatar Mar 08 '24 18:03 limes