This file contains hidden or 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
| import NextAuth, { type NextAuthOptions } from "next-auth"; | |
| import { JWT } from "next-auth/jwt"; | |
| import * as jwt from "jose"; | |
| export const authOptions: NextAuthOptions = { | |
| // the rest is just like in tutorials. Session, callbacks etc. | |
| jwt: { | |
| encode: async ({ secret, token }) => { | |
| if (!token) { | |
| console.warn("encode: No token provided"); |
This file contains hidden or 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
| Machine({ | |
| id: 'foo', | |
| initial: "load", | |
| states: { | |
| load: { | |
| invoke: { | |
| src: () => Promise.resolve(Math.random()), | |
| onDone: [{ | |
| target: 'ok', | |
| cond: (_, e) => e.data > 0.5 |
This file contains hidden or 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
| const button = Machine({ | |
| id: "button", | |
| type: "parallel", | |
| states: { | |
| size: { | |
| initial: "small", | |
| states: { | |
| small: {}, | |
| big: {}, | |
| }, |
This file contains hidden or 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
| /** | |
| * wybierz = actions.choose([{ | |
| cond: 'isPhone', | |
| target: 'phone' | |
| },{ | |
| cond: 'isPesel', | |
| target: 'pesel' | |
| }, { | |
| cond: 'isEmail', | |
| target: 'email' |
This file contains hidden or 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
| const Options = { | |
| actions: { | |
| setErrorInfo: "setErrorInfo", | |
| setInitializingData: "setInitializingData", | |
| setOfferTypeGroup: "setOfferTypeGroup", | |
| setOfferType: "setOfferType", | |
| setProcedure: "setProcedure", | |
| setOffer: "setOffer", | |
| setShouldAddAnotherDevice: "setShouldAddAnotherDevice", | |
| setSelectedProcesableContract: "setSelectedProcesableContract", |
This file contains hidden or 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
| const Options = { | |
| actions: { | |
| setContent: "setContent", | |
| setGroups: "setGroups", | |
| setSelectedType: "setSelectedType", | |
| setOnlyType: "setOnlyType", | |
| setSelectedUpsellOffer: "setSelectedUpsellOffer" | |
| }, | |
| services: { | |
| loadData: "loadData", |
This file contains hidden or 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
| const m = Machine({ | |
| initial: 'wejscie', | |
| states: { | |
| 'wejscie': { | |
| on: { | |
| '': [ | |
| { target: 'sprawdzenie', cond: 'jest na sg b2b albo b2c' }, | |
| { target: 'koniec' } |
This file contains hidden or 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
| Otworzenie portalu* | |
| Jest to strona SG B2C lub B2B? | |
| Tak -> Sprawdzenie ciastka | |
| Nie -> Koniec | |
| Sprawdzenie ciastka | |
| Uzytkownik jest w wersji A -> Wyślij B2B_rozbiegowka_test_A | |
| Użytkownik jest w wersji B -> Eventy dla wersji B | |
This file contains hidden or 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
| const m = Machine({ | |
| "id": "root", | |
| "states": { | |
| "Otworzenie portalu": { | |
| "id": "Otworzenie portalu", | |
| "states": { | |
| "Jest to strona SG B2C lub B2B?": { | |
| "id": "Jest to strona SG B2C lub B2B?", | |
| "states": {}, | |
| "on": { |
NewerOlder