Merge branch 'cas-fies' into 'main'
CAS Auth Fixes See merge request framasoft/mobilizon!1225
This commit is contained in:
commit
b3e7f23604
|
@ -140,4 +140,5 @@ export const SELECTED_PROVIDERS: { [key: string]: string } = {
|
||||||
google: "Google",
|
google: "Google",
|
||||||
keycloak: "Keycloak",
|
keycloak: "Keycloak",
|
||||||
ldap: "LDAP",
|
ldap: "LDAP",
|
||||||
|
cas: "CAS",
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,7 +18,9 @@
|
||||||
$t(
|
$t(
|
||||||
"Error while login with {provider}. Retry or login another way.",
|
"Error while login with {provider}. Retry or login another way.",
|
||||||
{
|
{
|
||||||
provider: $route.query.provider,
|
provider:
|
||||||
|
SELECTED_PROVIDERS[$route.query.provider] ||
|
||||||
|
"unknown provider",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}}</b-message
|
}}</b-message
|
||||||
|
@ -31,7 +33,9 @@
|
||||||
$t(
|
$t(
|
||||||
"Error while login with {provider}. This login provider doesn't exist.",
|
"Error while login with {provider}. This login provider doesn't exist.",
|
||||||
{
|
{
|
||||||
provider: $route.query.provider,
|
provider:
|
||||||
|
SELECTED_PROVIDERS[$route.query.provider] ||
|
||||||
|
"unknown provider",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}}</b-message
|
}}</b-message
|
||||||
|
@ -136,6 +140,7 @@ import {
|
||||||
initializeCurrentActor,
|
initializeCurrentActor,
|
||||||
NoIdentitiesException,
|
NoIdentitiesException,
|
||||||
saveUserData,
|
saveUserData,
|
||||||
|
SELECTED_PROVIDERS,
|
||||||
} from "../../utils/auth";
|
} from "../../utils/auth";
|
||||||
import { ILogin } from "../../types/login.model";
|
import { ILogin } from "../../types/login.model";
|
||||||
import {
|
import {
|
||||||
|
@ -198,6 +203,8 @@ export default class Login extends Vue {
|
||||||
email: validateEmailField,
|
email: validateEmailField,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SELECTED_PROVIDERS = SELECTED_PROVIDERS;
|
||||||
|
|
||||||
submitted = false;
|
submitted = false;
|
||||||
|
|
||||||
mounted(): void {
|
mounted(): void {
|
||||||
|
|
|
@ -4,6 +4,7 @@ defmodule Mobilizon.Web.AuthController do
|
||||||
alias Mobilizon.Service.Auth.Authenticator
|
alias Mobilizon.Service.Auth.Authenticator
|
||||||
alias Mobilizon.Users
|
alias Mobilizon.Users
|
||||||
alias Mobilizon.Users.User
|
alias Mobilizon.Users.User
|
||||||
|
import Mobilizon.Service.Guards, only: [is_valid_string: 1]
|
||||||
require Logger
|
require Logger
|
||||||
plug(:put_layout, false)
|
plug(:put_layout, false)
|
||||||
|
|
||||||
|
@ -106,7 +107,11 @@ defmodule Mobilizon.Web.AuthController do
|
||||||
defp email_from_ueberauth(%Ueberauth.Auth{
|
defp email_from_ueberauth(%Ueberauth.Auth{
|
||||||
extra: %Ueberauth.Auth.Extra{raw_info: %{user: %{"email" => email}}}
|
extra: %Ueberauth.Auth.Extra{raw_info: %{user: %{"email" => email}}}
|
||||||
})
|
})
|
||||||
when not is_nil(email) and email != "",
|
when is_valid_string(email),
|
||||||
|
do: email
|
||||||
|
|
||||||
|
defp email_from_ueberauth(%Ueberauth.Auth{info: %Ueberauth.Auth.Info{email: email}})
|
||||||
|
when is_valid_string(email),
|
||||||
do: email
|
do: email
|
||||||
|
|
||||||
defp email_from_ueberauth(_), do: nil
|
defp email_from_ueberauth(_), do: nil
|
||||||
|
|
Loading…
Reference in a new issue