本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
852B

  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package models
  5. import "fmt"
  6. // ErrOpenIDConnectInitialize represents a "OpenIDConnectInitialize" kind of error.
  7. type ErrOpenIDConnectInitialize struct {
  8. OpenIDConnectAutoDiscoveryURL string
  9. ProviderName string
  10. Cause error
  11. }
  12. // IsErrOpenIDConnectInitialize checks if an error is a ExternalLoginUserAlreadyExist.
  13. func IsErrOpenIDConnectInitialize(err error) bool {
  14. _, ok := err.(ErrOpenIDConnectInitialize)
  15. return ok
  16. }
  17. func (err ErrOpenIDConnectInitialize) Error() string {
  18. return fmt.Sprintf("Failed to initialize OpenID Connect Provider with name '%s' with url '%s': %v", err.ProviderName, err.OpenIDConnectAutoDiscoveryURL, err.Cause)
  19. }
上海开阖软件有限公司 沪ICP备12045867号-1