mikebronner / laravel-sign-in-with-apple

Provide "Sign In With Apple" functionality to your Laravel app.
MIT License
451 stars 67 forks source link

How to manage multiple callbacks for each user role? #40

Closed iamaz007 closed 3 years ago

iamaz007 commented 3 years ago

I am working on project where we have 2 different types of users, "doctors" and "patient", I have setup doctor sign in with apple, but how I can add another redirect url for "patient" too. so when Patient will login they will go to there controller as same doctor is doing Note: I have added both callback in apple account, only issue is remaining from website side, when I call from patient login it still go to doctor controller after callback.

mikebronner commented 3 years ago

HI @iamaz007, unfortunately that is not something that this package would be able to solve for you. You would need a way to differentiate between doctor and patient user records, and then redirect them in middleware to their appropriate location.

iamaz007 commented 3 years ago

I tried with session storage and cookies too, doctor and patient have separate login, so when they click on login I save their sessions, I have tested with Facebook and LinkedIn in Socialite they are working fine, but when I do this with apple login, apple clears all the sessions and cookies, that is why I am facing difficulty in both user authentication. Is there any parameter I can send with apple sign in, so on callback I can identify user

mikebronner commented 3 years ago

@iamaz007 I don't think that would work. I don't know that Apple would handle that.