-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplayground.fsx
37 lines (25 loc) · 871 Bytes
/
playground.fsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#load "main.fsx"
open AlarmsGlobal.Query
open System
open System.IO
open Microsoft.Extensions.Logging
open Microsoft.Extensions.DependencyInjection
open Giraffe.SerilogExtensions
open Microsoft.Extensions.Configuration
open Serilog
open Hocon.Extensions.Configuration
open AlarmsGlobal.Shared.Model
open AlarmsGlobal.Shared.Model.Authentication
open AlarmsGlobal.Server.Serilog
open AlarmsGlobal.ServerInterfaces.Command
open AlarmsGlobal.ServerInterfaces.Query
open FsToolkit.ErrorHandling
open Main
let userClientId = Email.TryCreate("[email protected]") |> forceValidate |> Email
let userIdentity = UserIdentity.CreateNew()
commandApi.LinkIdentity (CID.CreateNew()) (Some userIdentity) userClientId
|> Async.Ignore
|> Async.RunSynchronously
commandApi.UnlinkIdentity (CID.CreateNew()) ( userIdentity) userClientId
|> Async.Ignore
|> Async.RunSynchronously