mirror of
https://github.com/freckle/yesod-auth-oauth2.git
synced 2026-04-29 14:14:52 +02:00
Expose onDispatchError and generic error message (#150)
* Expose `onDispatchError` and generic `OtherDispatchError` * Update changelog and version * Restyled by prettier-markdown (#151) Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io <commits@restyled.io>
This commit is contained in:
parent
709805e8ee
commit
e4c2ea72d2
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,6 +1,12 @@
|
|||||||
## [_Unreleased_](https://github.com/thoughtbot/yesod-auth-oauth2/compare/v0.6.2.3...main)
|
## [_Unreleased_](https://github.com/thoughtbot/yesod-auth-oauth2/compare/v0.6.3.0...main)
|
||||||
|
|
||||||
- Don't throw exceptions; handle all errors through the set-message-redirect path
|
None
|
||||||
|
|
||||||
|
## [v0.6.3.0](https://github.com/thoughtbot/yesod-auth-oauth2/compare/v0.6.2.3...v0.6.3.0)
|
||||||
|
|
||||||
|
- Expose `onDispatchError` and generic `OtherDispatchError` for passthrough log
|
||||||
|
- Don't throw exceptions; handle all errors through the set-message-redirect
|
||||||
|
path
|
||||||
- Respect `onErrorHtml` for said error-handling
|
- Respect `onErrorHtml` for said error-handling
|
||||||
- Support custom widget in Google plugin
|
- Support custom widget in Google plugin
|
||||||
[@jmorag](https://github.com/freckle/yesod-auth-oauth2/pull/149)
|
[@jmorag](https://github.com/freckle/yesod-auth-oauth2/pull/149)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: yesod-auth-oauth2
|
name: yesod-auth-oauth2
|
||||||
version: "0.6.2.3" # N.B. PVP-compliant Semver: 0.MAJOR.MINOR.PATCH
|
version: "0.6.3.0" # N.B. PVP-compliant Semver: 0.MAJOR.MINOR.PATCH
|
||||||
synopsis: OAuth 2.0 authentication plugins
|
synopsis: OAuth 2.0 authentication plugins
|
||||||
description: Library to authenticate with OAuth 2.0 for Yesod web applications.
|
description: Library to authenticate with OAuth 2.0 for Yesod web applications.
|
||||||
category: Web
|
category: Web
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
module Yesod.Auth.OAuth2.DispatchError
|
module Yesod.Auth.OAuth2.DispatchError
|
||||||
( DispatchError(..)
|
( DispatchError(..)
|
||||||
, handleDispatchError
|
, handleDispatchError
|
||||||
|
, onDispatchError
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Monad.Except
|
import Control.Monad.Except
|
||||||
@ -33,6 +34,7 @@ data DispatchError
|
|||||||
| OAuth2ResultError (OAuth2Error Errors)
|
| OAuth2ResultError (OAuth2Error Errors)
|
||||||
| FetchCredsIOException IOException
|
| FetchCredsIOException IOException
|
||||||
| FetchCredsYesodOAuth2Exception YesodOAuth2Exception
|
| FetchCredsYesodOAuth2Exception YesodOAuth2Exception
|
||||||
|
| OtherDispatchError Text
|
||||||
deriving stock Show
|
deriving stock Show
|
||||||
deriving anyclass Exception
|
deriving anyclass Exception
|
||||||
|
|
||||||
@ -52,6 +54,7 @@ dispatchErrorMessage = \case
|
|||||||
OAuth2ResultError{} -> "Login failed, please try again"
|
OAuth2ResultError{} -> "Login failed, please try again"
|
||||||
FetchCredsIOException{} -> "Login failed, please try again"
|
FetchCredsIOException{} -> "Login failed, please try again"
|
||||||
FetchCredsYesodOAuth2Exception{} -> "Login failed, please try again"
|
FetchCredsYesodOAuth2Exception{} -> "Login failed, please try again"
|
||||||
|
OtherDispatchError{} -> "Login failed, please try again"
|
||||||
|
|
||||||
handleDispatchError
|
handleDispatchError
|
||||||
:: MonadAuthHandler site m
|
:: MonadAuthHandler site m
|
||||||
|
|||||||
@ -4,7 +4,7 @@ cabal-version: 1.12
|
|||||||
--
|
--
|
||||||
-- see: https://github.com/sol/hpack
|
-- see: https://github.com/sol/hpack
|
||||||
--
|
--
|
||||||
-- hash: 24b7f34906d427e1cdd3a015f9b67c7d1e69b9ecab88ab0ad8e8cba65777a003
|
-- hash: 11915a2e835dfb554a1ddca65479329c5ca6358094659e94899dcdacb8d5295b
|
||||||
|
|
||||||
name: yesod-auth-oauth2
|
name: yesod-auth-oauth2
|
||||||
version: 0.6.2.3
|
version: 0.6.2.3
|
||||||
@ -35,6 +35,7 @@ flag example
|
|||||||
|
|
||||||
library
|
library
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
|
UnliftIO.Except
|
||||||
URI.ByteString.Extension
|
URI.ByteString.Extension
|
||||||
Yesod.Auth.OAuth2
|
Yesod.Auth.OAuth2
|
||||||
Yesod.Auth.OAuth2.AzureAD
|
Yesod.Auth.OAuth2.AzureAD
|
||||||
@ -42,6 +43,7 @@ library
|
|||||||
Yesod.Auth.OAuth2.Bitbucket
|
Yesod.Auth.OAuth2.Bitbucket
|
||||||
Yesod.Auth.OAuth2.ClassLink
|
Yesod.Auth.OAuth2.ClassLink
|
||||||
Yesod.Auth.OAuth2.Dispatch
|
Yesod.Auth.OAuth2.Dispatch
|
||||||
|
Yesod.Auth.OAuth2.DispatchError
|
||||||
Yesod.Auth.OAuth2.ErrorResponse
|
Yesod.Auth.OAuth2.ErrorResponse
|
||||||
Yesod.Auth.OAuth2.EveOnline
|
Yesod.Auth.OAuth2.EveOnline
|
||||||
Yesod.Auth.OAuth2.Exception
|
Yesod.Auth.OAuth2.Exception
|
||||||
@ -50,6 +52,7 @@ library
|
|||||||
Yesod.Auth.OAuth2.Google
|
Yesod.Auth.OAuth2.Google
|
||||||
Yesod.Auth.OAuth2.Nylas
|
Yesod.Auth.OAuth2.Nylas
|
||||||
Yesod.Auth.OAuth2.Prelude
|
Yesod.Auth.OAuth2.Prelude
|
||||||
|
Yesod.Auth.OAuth2.Random
|
||||||
Yesod.Auth.OAuth2.Salesforce
|
Yesod.Auth.OAuth2.Salesforce
|
||||||
Yesod.Auth.OAuth2.Slack
|
Yesod.Auth.OAuth2.Slack
|
||||||
Yesod.Auth.OAuth2.Spotify
|
Yesod.Auth.OAuth2.Spotify
|
||||||
@ -72,8 +75,10 @@ library
|
|||||||
, http-types >=0.8 && <0.13
|
, http-types >=0.8 && <0.13
|
||||||
, memory
|
, memory
|
||||||
, microlens
|
, microlens
|
||||||
|
, mtl
|
||||||
, safe-exceptions
|
, safe-exceptions
|
||||||
, text >=0.7 && <2.0
|
, text >=0.7 && <2.0
|
||||||
|
, unliftio
|
||||||
, uri-bytestring
|
, uri-bytestring
|
||||||
, yesod-auth >=1.6.0 && <1.7
|
, yesod-auth >=1.6.0 && <1.7
|
||||||
, yesod-core >=1.6.0 && <1.7
|
, yesod-core >=1.6.0 && <1.7
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user