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

Integrate Custom Authentication Endpoints with Frontend #22

Closed
AbdulrhmnGhanem opened this issue Aug 26, 2020 · 5 comments
Closed

Integrate Custom Authentication Endpoints with Frontend #22

AbdulrhmnGhanem opened this issue Aug 26, 2020 · 5 comments

Comments

@AbdulrhmnGhanem
Copy link
Member

AbdulrhmnGhanem commented Aug 26, 2020

This is part of #6. The authentication flow should be more clear to solve the problems that originated from this commit.

  • The sign-in is broken, it authenticates correctly yet redirects to the Gitea homepage as if the user signed in from the Gitea login page. A possible solution would be to just generate the token and send it to the frontend, let the frontend handle the reset of the sign-in flow.
  • Both reset password and forgot password are completely broken. They sign in the user. Probably this has something to do with context.
  • How will context be passed from frontend to the backend? and the other way around?
@AbdulrhmnGhanem
Copy link
Member Author

Actually, after signing-in all whatever endpoint is called it signs the user in. Probably because of cookie although I see no cookies. 🤔

@kasbah
Copy link
Member

kasbah commented Aug 26, 2020

You don't see any cookies? How are you looking for them? Gitea generally sets three cookies: i_like_gitea, _csrf and lang. I (can see them e.g. on https://staging.kitspace.org).

@AbdulrhmnGhanem
Copy link
Member Author

AbdulrhmnGhanem commented Aug 26, 2020 via email

@AbdulrhmnGhanem
Copy link
Member Author

  • A possible solution would be to just generate the token and send it to the frontend, let the frontend handle the reset of the sign-in flow.
  • How will context be passed from frontend to the backend? and the other way around?

Can you address those? Do you have a design in your mind?

@kasbah
Copy link
Member

kasbah commented Aug 26, 2020

I think it can work like this:

we POST gitea.kitspace.test:3000/user/kitspace/sign_in with JSON

The user now has the session cookie and is authenticated on both gitea.kitspace.test and kitspace.test. Do we need any more context than that?

I do feel it's getting a bit complicated by developing our own endpoints, that wasn't in the original plan. Let's discuss on a call later.

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

No branches or pull requests

2 participants