Skip to content

Commit

Permalink
Backport from #20
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelWei committed Jul 19, 2022
1 parent 5a95dc7 commit b8251a5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/Http/Resources/ApplicationSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public function toArray($request)
'retention_period' => intval(setting('attendance.retention_period')),
],
'room_token_expiration' => intval(setting('room_token_expiration')),
'ldap' => config('ldap.enabled'),
];
}
}
2 changes: 2 additions & 0 deletions config/ldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

return [

'enabled' => env('LDAP_ENABLED', false),

/*
|--------------------------------------------------------------------------
| Default LDAP Connection Name
Expand Down
8 changes: 7 additions & 1 deletion resources/js/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="col-12 col-md-8 col-lg-6 offset-md-2 offset-lg-3">
<b-card no-body bg-variant="light">
<b-tabs content-class="m-3" align="center" fill active-nav-item-class="bg-success text-white">
<b-tab :title="$t('auth.ldap.tabTitle')" active>
<b-tab :title="$t('auth.ldap.tabTitle')" v-if="settings('ldap')" >
<ldap-login-component
id="ldap"
:title="$t('auth.ldap.title')"
Expand Down Expand Up @@ -40,6 +40,7 @@ import EmailLoginComponent from '../components/Login/EmailLoginComponent';
import LdapLoginComponent from '../components/Login/LdapLoginComponent';
import env from '../env';
import Base from '../api/base';
import { mapGetters } from 'vuex';
export default {
components: {
Expand All @@ -55,6 +56,11 @@ export default {
}
};
},
computed: {
...mapGetters({
settings: 'session/settings'
})
},
methods: {
/**
* Handle login request
Expand Down
4 changes: 3 additions & 1 deletion routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
})->name('setLocale');

Route::post('login', [LoginController::class,'usersLogin'])->name('login');
Route::post('login/ldap', [LoginController::class,'ldapLogin'])->name('ldapLogin');
if (config('ldap.enabled')) {
Route::post('login/ldap', [LoginController::class,'ldapLogin'])->name('ldapLogin');
}
Route::post('logout', [LoginController::class,'logout'])->name('logout');
Route::post('password/reset', [ResetPasswordController::class,'reset'])->name('password.reset')->middleware(['guest', 'throttle:password_reset']);

Expand Down

0 comments on commit b8251a5

Please sign in to comment.