Skip to content

Commit

Permalink
chore: changed route name and fixed type on web post function
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCaliman committed Jul 11, 2024
1 parent f486755 commit ee2405a
Show file tree
Hide file tree
Showing 9 changed files with 246 additions and 183 deletions.
2 changes: 1 addition & 1 deletion api/.aeria/aeria-sdk.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ declare type MirrorRouter = {
"/test": {
"GET": null
},
"/github/githubAuth": {
"/github/auth": {
"POST": null
}
}
Expand Down
358 changes: 210 additions & 148 deletions api/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"aeria": "^0.0.137",
"aeria-sdk": "^0.0.109"
"aeria": "^0.0.143",
"aeria-sdk": "^0.0.113"
}
}
2 changes: 1 addition & 1 deletion api/src/routes/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function fetchUser(token: string) {
return response
}

githubRouter.POST('/githubAuth', async(context)=>{
githubRouter.POST('/auth', async(context)=>{
const gitTempToken = await exchangeCodeForAccessToken(context.request.payload.code) //swap code for access token
const gitTempUser = await fetchUser(gitTempToken.access_token) // get github user data

Expand Down
2 changes: 1 addition & 1 deletion web/.aeria-ui/aeria-sdk.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ declare type MirrorRouter = {
"/test": {
"GET": null
},
"/github/githubAuth": {
"/github/auth": {
"POST": null
}
}
Expand Down
1 change: 1 addition & 0 deletions web/.aeria-ui/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export {}
declare module '@vue/runtime-core' {
export interface GlobalComponents {
AeriaButton: typeof import('@aeria-ui/ui')['AeriaButton']
AeriaCrud: typeof import('@aeria-ui/ui')['AeriaCrud']
AeriaIcon: typeof import('@aeria-ui/ui')['AeriaIcon']
AeriaPanel: typeof import('@aeria-ui/ui')['AeriaPanel']
NoResults: typeof import('./../src/components/no-results.vue')['default']
Expand Down
52 changes: 26 additions & 26 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"dependencies": {
"@aeria-ui/i18n-en": "^0.0.3",
"aeria-app-layout": "^0.0.41",
"aeria-sdk": "^0.0.109",
"aeria-ui": "^0.0.80"
"aeria-sdk": "^0.0.113",
"aeria-ui": "^0.0.89"
},
"devDependencies": {
"autoprefixer": "^10.4.19",
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/redirect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ onMounted(async ()=>{
//if github code exists call API authentication route
if(gitTempCode){
const {error,result}: Result.Either<EndpointError, SuccessfulAuthentication>= await aeria.github.githubAuth.POST({
const {error,result} = await aeria.github.auth.POST<Result.Either<EndpointError, SuccessfulAuthentication>>({
code: gitTempCode
}) as any //this casting 'as any' is necessary only because there's no contract on route
}) //this casting 'as any' is necessary only because there's no contract on route
if(error){
//if authentication fails, go back to login page
router.push('/githubAuth')
Expand Down

0 comments on commit ee2405a

Please sign in to comment.