2019-06-04 13:33:00 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Devise controller for handling client sessions
|
2015-05-05 03:10:25 +02:00
|
|
|
class SessionsController < Devise::SessionsController
|
2016-03-23 18:39:41 +01:00
|
|
|
def new
|
2023-03-29 18:01:16 +02:00
|
|
|
active_provider = Rails.configuration.auth_provider
|
|
|
|
if active_provider.providable_type == 'DatabaseProvider'
|
2016-03-23 18:39:41 +01:00
|
|
|
super
|
2023-03-29 18:01:16 +02:00
|
|
|
else
|
2023-03-30 17:17:02 +02:00
|
|
|
redirect_post "/users/auth/#{active_provider.strategy_name}"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
end
|
2023-03-31 11:33:50 +02:00
|
|
|
|
|
|
|
# FIXME, Method DELETE is not allowed by Access-Control-Allow-Methods in preflight response.
|
|
|
|
# def destroy
|
|
|
|
# active_provider = Rails.configuration.auth_provider
|
|
|
|
# if active_provider.providable_type == 'OpenIdConnectProvider'
|
|
|
|
# redirect_to "/users/auth/#{active_provider.strategy_name}/logout"
|
|
|
|
# else
|
|
|
|
# super
|
|
|
|
# end
|
|
|
|
# end
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|