-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new-session-secret binary (#1922)
* Added new-session-secret binary * added notes on how generate a new session secret using new-session-secret * fixed cabal build
- Loading branch information
1 parent
8e6a234
commit d075ea3
Showing
3 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Main where | ||
|
||
import Prelude | ||
import Main.Utf8 (withUtf8) | ||
import qualified Web.ClientSession as ClientSession | ||
import qualified Data.ByteString as ByteString | ||
import qualified Data.ByteString.Char8 as Char8 | ||
import qualified Data.ByteString.Base64 as Base64 | ||
|
||
-- Prints a private key to be used as the IHP_SESSION_SECRET | ||
main :: IO () | ||
main = withUtf8 do | ||
(string, _) <- ClientSession.randomKey | ||
let encoded = Base64.encode string | ||
ByteString.putStr encoded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters