mirror of
https://github.com/42wim/matterbridge.git
synced 2024-12-10 19:22:00 -08:00
4dd8bae5c9
* Update dependencies * Update module to go 1.17
26 lines
463 B
Go
26 lines
463 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package model
|
|
|
|
import (
|
|
"encoding/json"
|
|
"io"
|
|
)
|
|
|
|
type MfaSecret struct {
|
|
Secret string `json:"secret"`
|
|
QRCode string `json:"qr_code"`
|
|
}
|
|
|
|
func (mfa *MfaSecret) ToJson() string {
|
|
b, _ := json.Marshal(mfa)
|
|
return string(b)
|
|
}
|
|
|
|
func MfaSecretFromJson(data io.Reader) *MfaSecret {
|
|
var mfa *MfaSecret
|
|
json.NewDecoder(data).Decode(&mfa)
|
|
return mfa
|
|
}
|