-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description With the upcoming changes everyone should be able to run kampus(basic level). # Changes - [x] `@kampus-apps/gql` has been named to `@kampus/gql` - [x] Respective commands and settings has been updated to match the naming - [x] `@kampus-apps/ui` has been named to `@kampus/ui` - [x] Ports has been identified and set for "gql, kampus, pasaport" - [x] @kampus/kampus now has `3000` port! - [x] @kampus/gql now has `4000` port! - [x] @kampus/pasaport now has `3001` port! - [x] Session issue has been addressed where it was using functionalities where it should not have. See more description below. - [x] Commands has been added (Usages are now on turbo instead of individual commands), documentation has been adjusted with deletion of setup; since Turbo dependencies builds the app that step is no longer relevant. - [x] `npm run dev` runs all "dev" commands on each package inside the workspace - [x] `npm run gql` runs only "gql" server so backend work can be done separetly. - [x] `npm run web` runs "gql", "kampus" and "pasaport" apps so the platform can be alive with 1 command. - [x] @kampus/kampus#dev dependencies has been updated due to dependant "dev" commands never finishes/exits. This was causing that application to never start. ## Session Issue GQL server (aka: backend) was trying to setup whole "next-auth" inside the "gql" server where it is not necessary to setup and run there. Next-auth has "session" endpoint where session can be retrieved by cookie ([doc](https://next-auth.js.org/getting-started/rest-api#get-apiauthsession)) Issue has been addressed by asking session info to "pasaport" by adding "cookie" to the request so concerns are separated. ### How were these changes tested? You should be able to run all the commands above and should receive no error. When you either have session or not "gql" setup should not give you error but you should be able to access your session as before.⚠️ ⚠️ ⚠️ ⚠️ @usirin all the redirect URL's on 3rd Party Auth setups should be redirecting back to either kampus application or we should discuss where should we redirect after login. Flow right now: Kampus(pano, sozluk)-> login -> pasaport(login) -> 3rd party -> pasaport(index) at the moment 404 Suggestion: Kampus(pano, sozluk)-> login -> pasaport(login with redirect url or similar) -> 3rd party -> pasaport(index) use redirect uri or similar solution to redirect back to the app it's coming from --------- Co-authored-by: Umut Sirin <[email protected]>
- Loading branch information
Showing
66 changed files
with
183 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
NODE_ENV=development | ||
DATABASE_URL=mysql://kampus:kampus@localhost:3306/kampus?schema=public | ||
NEXTAUTH_URL=http://localhost:3002/auth | ||
NEXTAUTH_URL=http://localhost:3001/auth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { type Session } from "@kampus/next-auth"; | ||
|
||
import { env } from "../../env"; | ||
|
||
export const getSession = async (request: Request) => { | ||
const headers = new Headers(request.headers); | ||
try { | ||
const cookie = headers.get("cookie"); | ||
const session = (await fetch(`${env.NEXTAUTH_URL}/session`, { | ||
method: "GET", | ||
headers: { | ||
cookie: cookie || "", | ||
}, | ||
}).then((res) => res.json())) as Session; | ||
|
||
return session; | ||
} catch (e) { | ||
// handle error for session request fails | ||
return null; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"plugins": [{ "name": "next" }] | ||
"plugins": [ | ||
{ | ||
"name": "next" | ||
} | ||
] | ||
}, | ||
"include": ["next-env.d.ts", "next.config.mjs", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], | ||
"exclude": ["node_modules"] | ||
"include": [ | ||
"next-env.d.ts", | ||
"next.config.mjs", | ||
"**/*.ts", | ||
"**/*.tsx", | ||
".next/types/**/*.ts" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
apps/ui/.storybook/preview.tsx → apps/studio/.storybook/preview.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/ui/stories/Avatar.stories.tsx → apps/studio/stories/Avatar.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/ui/stories/Button.stories.tsx → apps/studio/stories/Button.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/ui/stories/Checkbox.stories.tsx → apps/studio/stories/Checkbox.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/ui/stories/Label.stories.tsx → apps/studio/stories/Label.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/ui/stories/Loading.stories.tsx → apps/studio/stories/Loading.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.