Commit 7092341b authored by Jörg Richter's avatar Jörg Richter

Login with selected auth method (#168)

parent fa2164a9
Pipeline #6539 passed with stages
in 3 minutes and 45 seconds
......@@ -725,7 +725,7 @@ public class AccessControlPlugin extends PluginActivator implements AccessContro
private AuthorizationMethod getAuthorizationMethod(String name) {
AuthorizationMethod am = authorizationMethods.get(name);
if (am == null) {
throw new RuntimeException("Authorization method \"" + name + "\" is not registered");
throw new RuntimeException("Authorization method \"" + name + "\" is unknown");
}
return am;
}
......
......@@ -5,14 +5,14 @@ const ENCODED_PASSWORD_PREFIX = '-SHA256-'
const state = {
username: undefined, // the logged in user (string); falsish if no user is logged in
authMethods: ['Basic'], // names of installed auth methods (array of string), may be empty
authMethods: ['Basic'], // names of installed auth methods (array of string)
visible: false // Login dialog visibility
}
const actions = {
login ({dispatch}, credentials) {
return dm5.restClient.login(credentials).then(() => {
login ({dispatch}, {credentials, authMethod}) {
return dm5.restClient.login(credentials, authMethod).then(() => {
const username = credentials.username
console.log('Login', username)
setUsername(username)
......
......@@ -60,7 +60,10 @@ export default {
methods: {
login () {
this.$store.dispatch('login', this.credentials).then(success => {
this.$store.dispatch('login', {
credentials: this.credentials,
authMethod: this.authMethod
}).then(success => {
if (success) {
this.message = 'Login OK'
this.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment