mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-15 05:33:02 -06:00
[feature] overhaul the oidc system (#961)
* [feature] overhaul the oidc system this allows for more flexible username handling and prevents account takeover using old email addresses * [feature] add migration path for old OIDC users * [feature] nicer error reporting for users * [docs] document the new OIDC flow * [fix] return early on oidc error * [docs]: add comments on the finalization logic
This commit is contained in:
parent
1a3f26fb5c
commit
199b685f43
20 changed files with 335 additions and 119 deletions
|
|
@ -1545,6 +1545,31 @@ func GetOIDCScopes() []string { return global.GetOIDCScopes() }
|
|||
// SetOIDCScopes safely sets the value for global configuration 'OIDCScopes' field
|
||||
func SetOIDCScopes(v []string) { global.SetOIDCScopes(v) }
|
||||
|
||||
// GetOIDCLinkExisting safely fetches the Configuration value for state's 'OIDCLinkExisting' field
|
||||
func (st *ConfigState) GetOIDCLinkExisting() (v bool) {
|
||||
st.mutex.Lock()
|
||||
v = st.config.OIDCLinkExisting
|
||||
st.mutex.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
// SetOIDCLinkExisting safely sets the Configuration value for state's 'OIDCLinkExisting' field
|
||||
func (st *ConfigState) SetOIDCLinkExisting(v bool) {
|
||||
st.mutex.Lock()
|
||||
defer st.mutex.Unlock()
|
||||
st.config.OIDCLinkExisting = v
|
||||
st.reloadToViper()
|
||||
}
|
||||
|
||||
// OIDCLinkExistingFlag returns the flag name for the 'OIDCLinkExisting' field
|
||||
func OIDCLinkExistingFlag() string { return "oidc-link-existing" }
|
||||
|
||||
// GetOIDCLinkExisting safely fetches the value for global configuration 'OIDCLinkExisting' field
|
||||
func GetOIDCLinkExisting() bool { return global.GetOIDCLinkExisting() }
|
||||
|
||||
// SetOIDCLinkExisting safely sets the value for global configuration 'OIDCLinkExisting' field
|
||||
func SetOIDCLinkExisting(v bool) { global.SetOIDCLinkExisting(v) }
|
||||
|
||||
// GetSMTPHost safely fetches the Configuration value for state's 'SMTPHost' field
|
||||
func (st *ConfigState) GetSMTPHost() (v string) {
|
||||
st.mutex.Lock()
|
||||
|
|
@ -1919,3 +1944,4 @@ func GetAdminMediaPruneDryRun() bool { return global.GetAdminMediaPruneDryRun()
|
|||
|
||||
// SetAdminMediaPruneDryRun safely sets the value for global configuration 'AdminMediaPruneDryRun' field
|
||||
func SetAdminMediaPruneDryRun(v bool) { global.SetAdminMediaPruneDryRun(v) }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue