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

feat: add GET /connect/session endpoint #2776

Merged
merged 9 commits into from
Sep 27, 2024

Conversation

TBonnin
Copy link
Collaborator

@TBonnin TBonnin commented Sep 26, 2024

Describe your changes

depends on #2769

  • add auth middleware to be able to authenticate via the connect session token
  • add GET /connect/session endpoint
  • add DELETE /connect/session endpoint

Issue ticket number and link

https://linear.app/nango/issue/NAN-1775/[server]-api-endpoints-to-getpost-sessions

Copy link

linear bot commented Sep 26, 2024

@TBonnin TBonnin force-pushed the tbonnin/nan-1775/get-connect-session branch from 74a3350 to 6fabe59 Compare September 26, 2024 19:18
packages/server/lib/controllers/connect/deleteSession.ts Outdated Show resolved Hide resolved
packages/server/lib/middleware/access.middleware.ts Outdated Show resolved Hide resolved
if (session.isErr()) {
return Err(session.error);
}
return Ok(session.value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can't return session directly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant this:

Suggested change
return Ok(session.value);
return session

instead of the current if err ok

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok yes. you are right. the unwrapping/wrapping is unnecessary. I will fix next time I touch the code

packages/types/lib/connect/api.ts Outdated Show resolved Hide resolved
packages/types/lib/connect/api.ts Outdated Show resolved Hide resolved
@TBonnin TBonnin force-pushed the tbonnin/nan-1775/post-connect-sessions branch from d8b2789 to e96c39b Compare September 27, 2024 14:17
@TBonnin TBonnin force-pushed the tbonnin/nan-1775/get-connect-session branch 2 times, most recently from f44b70b to 8d8db83 Compare September 27, 2024 15:45
@TBonnin TBonnin force-pushed the tbonnin/nan-1775/get-connect-session branch from 8d8db83 to c243733 Compare September 27, 2024 15:52
@TBonnin TBonnin force-pushed the tbonnin/nan-1775/post-connect-sessions branch from e96c39b to 79808f9 Compare September 27, 2024 17:14
Base automatically changed from tbonnin/nan-1775/post-connect-sessions to master September 27, 2024 17:41
* master:
  feat:  add POST /connect/sessions endpoint (#2769)
  fix(jobs): missing timeout value (#2781)
@TBonnin TBonnin merged commit d7c28b9 into master Sep 27, 2024
26 checks passed
@TBonnin TBonnin deleted the tbonnin/nan-1775/get-connect-session branch September 27, 2024 18:23
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

Successfully merging this pull request may close these issues.

2 participants