From 714467b4d1e718eae7897eed49ae455d60515076 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Wed, 5 Apr 2023 17:55:36 -0400 Subject: [PATCH] Document Example in README --- README.md | 20 ++++++++++++++++++++ example/Main.hs | 13 ------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 64a1fe4..38349e1 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,26 @@ stack build --pedantic --test Please also run HLint and Weeder before submitting PRs. +## Example + +This project includes an executable that runs a server with (almost) all +supported providers present. + +To use: + +1. `cp .env.example .env` and edit in secrets for providers you wish to test + + Be sure to include `http://localhost:3000/auth/page/{plugin}/callback` as a + valid Redirect URI when configuring the OAuth application. + +2. Build with the example: `stack build ... --flag yesod-auth-oauth2:example` +3. Run the example `stack exec yesod-auth-oauth2-example` +4. Visit the example: `$BROWSER http://localhost:3000` +5. Click the log-in link for the provider you configured + +If successful, you will be presented with a page that shows the credential and +User response value. + --- [CHANGELOG](./CHANGELOG.md) | [LICENSE](./LICENSE) diff --git a/example/Main.hs b/example/Main.hs index 25b63b4..66fdf00 100644 --- a/example/Main.hs +++ b/example/Main.hs @@ -6,19 +6,6 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} --- | --- --- This single-file Yesod app uses all plugins defined within this site, as a --- means of manual verification that they work. When adding a new plugin, add --- usage of it here and verify locally that it works. --- --- To do so, see @.env.example@, then: --- --- > stack build --flag yesod-auth-oauth2:example --- > stack exec yesod-auth-oauth2-example --- > --- > $BROWSER http://localhost:3000 --- module Main where import Data.Aeson