Skip to content
Snippets Groups Projects
Commit 8ef7f0be authored by Florent Lavelle's avatar Florent Lavelle Committed by m431m
Browse files

Add external auth btn (optional)

parent 7a057349
No related branches found
No related tags found
No related merge requests found
Pipeline #12955 passed with warnings
......@@ -36,7 +36,7 @@ build_development:
- echo -e "
NODE_ENV=development\n
DOMAIN=https://dev.pigma.neogeo.fr/fr\n
VUE_APP_DOMAIN=https://dev.pigma.neogeo.fr/\n
VUE_APP_DOMAIN=${DOMAIN}\n
BASE_PATH=/\n
VUE_APP_BASE_PATH=${BASE_PATH}\n
VUE_APP_NEXT_DEFAULT=/\n
......@@ -50,7 +50,11 @@ build_development:
VUE_APP_FAVICON_URL=${VUE_APP_DOMAIN}/assets/favicon.png\n
VUE_APP_LOGIN_API_PATH=/fr/login/\n
VUE_APP_ORGANISATION_API_PATH=/fr/organisation/\n
VUE_APP_USERGROUP_API_PATH=/fr/usergroup/\n" > .env
VUE_APP_USERGROUP_API_PATH=/fr/usergroup/\n
VUE_APP_EXTERNAL_LOGIN=true\n
VUE_APP_EXTERNAL_LOGIN_URL=http://127.0.0.1:80/oidc/authenticate\n
VUE_APP_EXTERNAL_LOGIN_LABEL=Se connecter avec mon compte FooBar\n
" > .env
- npm run build
artifacts:
paths:
......
......@@ -42,6 +42,11 @@ VUE_APP_USERGROUP_API_PATH=/fr/usergroup/
# AUTH
VUE_APP_LOGIN_API_USERNAME=admin
VUE_APP_LOGIN_API_PASSWORD=CHANGE_ME
# External auth
VUE_APP_EXTERNAL_LOGIN=true
VUE_APP_EXTERNAL_LOGIN_URL=http://127.0.0.1/oidc/authenticate
VUE_APP_EXTERNAL_LOGIN_LABEL=Connect with...
```
### Compiles and hot-reloads for development
......
......@@ -6,7 +6,7 @@ export default {
/^\/portail/,
],
client: {
name: "Demo",
name: "Neogeo",
email: "contact@neogeo.fr"
},
forms: {
......
......@@ -4,6 +4,23 @@
<div class="sign-in-header">
<img alt="logo" :src="logoPath"/>
</div>
<div
v-if="externalAuth.enabled"
class="sign-in-form"
>
<h5 class="title">{{ externalAuth.label }}</h5>
<form>
<div class="form-row">
<b-button
variant="primary"
block
@click.prevent="submitExternalAuth"
>
{{ $t('words.login') }}
</b-button>
</div>
</form>
</div>
<div class="sign-in-form">
<h5
v-if="$config.forms.signin.title"
......@@ -119,6 +136,10 @@ import {
mapMutations,
} from 'vuex';
// const EXTERNAL_LOGIN = process.env.VUE_APP_EXTERNAL_LOGIN;
// const EXTERNAL_LOGIN_URL = process.env.VUE_APP_EXTERNAL_LOGIN_URL;
// const EXTERNAL_LOGIN_LABEL = process.env.VUE_APP_EXTERNAL_LOGIN_LABEL
const signInActions = [
'POST_SIGNIN'
];
......@@ -134,6 +155,12 @@ export default {
data() {
return {
externalAuth: {
enabled: process.env.VUE_APP_EXTERNAL_LOGIN,
url: process.env.VUE_APP_EXTERNAL_LOGIN_URL,
label: process.env.VUE_APP_EXTERNAL_LOGIN_LABEL
},
showPassword: false,
btnPressed: false,
form: {
......@@ -192,6 +219,9 @@ export default {
this.btnPressed = true;
await this.POST_SIGNIN();
},
submitExternalAuth() {
window.location.href = this.externalAuth.url;
}
},
};
</script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment