aboutsummaryrefslogtreecommitdiffstats
path: root/web/stores/login-options.ts
blob: fd97a7586f26f6c8b5b41ac0b49f59d4dbab266c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { defineStore } from "pinia";

interface LoginOption {
  name: string;
  identifier: string;
  type: string;
}

export const useLoginOptionsStore = defineStore('loginOptions', () => {
  const loginOptions = ref([] as LoginOption[])
  const status = ref('idle' as 'idle' | 'pending')

  const setLoginOptions = (newLoginOptions: LoginOption[]) => {
    loginOptions.value = newLoginOptions
  } 

  const setStatus = (newStatus: 'idle' | 'pending') => {
    status.value = newStatus
  }

  return {loginOptions, status, setLoginOptions, setStatus}
})