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

Added Okta Login for newer versions of Doccano #2079

Merged
merged 9 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix prettier issue
  • Loading branch information
Clovin committed Dec 2, 2022
commit 272103ee76f91936286ef4e7708dfd6628734a85
15 changes: 8 additions & 7 deletions frontend/components/auth/SocialLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
color="secondary"
:href="item.href"
>
Login With {{item.provider}}
Login With {{ item.provider }}
</v-btn>
</div>
</template>
Expand All @@ -29,16 +29,17 @@ export default Vue.extend({
}
},
async mounted() {
const response = await this.fetchSocialLink();
const response = await this.fetchSocialLink()
this.social = Object.entries(response)
.map(([key, value]: any) => ({
provider: key,
value,
})).filter((item) => !!item.value?.authorize_url)
value
}))
.filter((item) => !!item.value?.authorize_url)
.map((item: any) => ({
...item,
href: `${item.value.authorize_url}&redirect_uri=${location.origin}${item.value.redirect_path}`,
}));
},
href: `${item.value.authorize_url}&redirect_uri=${location.origin}${item.value.redirect_path}`
}))
}
})
</script>
6 changes: 3 additions & 3 deletions frontend/pages/auth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<v-row align="center" justify="center">
<v-col cols="12" sm="8" md="4">
<form-login :login="authenticateUser" />
<social-login :fetch-social-link='fetchSocialLink' />

<social-login :fetch-social-link="fetchSocialLink" />
</v-col>
</v-row>
</v-container>
Expand All @@ -23,7 +23,7 @@ import SocialLogin from '@/components/auth/SocialLogin.vue'
export default Vue.extend({
components: {
FormLogin,
SocialLogin,
SocialLogin
},

methods: {
Expand Down
2 changes: 1 addition & 1 deletion frontend/repositories/auth/apiAuthRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class APIAuthRepository implements AuthRepository {

async socialLink(): Promise<any[]> {
const url = '/social/links/'
const response = await this.request.get(url);
const response = await this.request.get(url)
return response.data
}
}