Compare commits

...

4 Commits

6 changed files with 17 additions and 4 deletions

View File

@ -15,7 +15,12 @@ export const redirectToProvider = (provider: IProvider, redirectUrl = '') => {
const state = createRandomID(24)
localStorage.setItem('state', state)
window.location.href = `${provider.authUrl}?client_id=${provider.clientId}&redirect_uri=${redirectUrl}${provider.key}&response_type=code&scope=openid email profile&state=${state}`
let scope = 'openid email profile'
if (provider.scope !== null){
scope = provider.scope
}
window.location.href = `${provider.authUrl}?client_id=${provider.clientId}&redirect_uri=${redirectUrl}${provider.key}&response_type=code&scope=${scope}&state=${state}`
}
export const redirectToProviderOnLogout = (provider: IProvider) => {
if (provider.logoutUrl.length > 0){

View File

@ -9,6 +9,7 @@ export interface ITeam extends IAbstract {
description: string
members: ITeamMember[]
right: Right
oidcId: string
createdBy: IUser
created: Date

View File

@ -13,6 +13,7 @@ export default class TeamModel extends AbstractModel<ITeam> implements ITeam {
description = ''
members: ITeamMember[] = []
right: Right = RIGHTS.READ
oidcId = ''
createdBy: IUser = {} // FIXME: seems wrong
created: Date = null

View File

@ -4,4 +4,5 @@ export interface IProvider {
authUrl: string;
clientId: string;
logoutUrl: string;
scope: string;
}

View File

@ -3,7 +3,7 @@
class="loader-container is-max-width-desktop"
:class="{ 'is-loading': teamService.loading }"
>
<card class="is-fullwidth" v-if="userIsAdmin" :title="title">
<card class="is-fullwidth" v-if="userIsAdmin && team.oidcId == 0" :title="title">
<form @submit.prevent="save()">
<div class="field">
<label class="label" for="teamtext">{{ $t('team.attributes.name') }}</label>
@ -63,7 +63,7 @@
</card>
<card class="is-fullwidth has-overflow" :title="$t('team.edit.members')" :padding="false">
<div class="p-4" v-if="userIsAdmin">
<div class="p-4" v-if="userIsAdmin && team.oidcId == 0">
<div class="field has-addons">
<div class="control is-expanded">
<multiselect

View File

@ -12,7 +12,12 @@
<ul class="teams box" v-if="teams.length > 0">
<li :key="t.id" v-for="t in teams">
<router-link :to="{name: 'teams.edit', params: {id: t.id}}">
{{ t.name }}
<p v-if="t.oidcId != 0">
{{ t.name }}{{ " (sso: " + t.oidcId + ")" }}
</p>
<p v-else>
{{ t.name }}
</p>
</router-link>
</li>
</ul>