I will most likely need to store auth tokens in a database, as I can only really get one auth related value from the user, and I can't change that value. I will probably send the oauth token as: {user did}/{generated uuid}/{encryptionkey} Since the only way to detect if a user has logged out is "/1/
| 49 | |
| 50 | // Token represents the schema for the tokens table |
| 51 | type Token struct { |
| 52 | BasicAuthHash string `gorm:"type:string;"` // I am not a fan that i have to store this for basic authentication |
| 53 | BasicAuthUsername string `gorm:"type:string;index"` // Add this field with an index |
| 54 | UserDid string `gorm:"type:string;index;not null"` |
| 55 | UserPDS string `gorm:"type:string;not null"` |
| 56 | TokenUUID string `gorm:"type:string;primaryKey"` |
| 57 | EncryptedAccessToken string `gorm:"type:string;not null"` |
| 58 | EncryptedRefreshToken string `gorm:"type:string;not null"` |
| 59 | AccessExpiry float64 `gorm:"type:float;not null"` |
| 60 | RefreshExpiry float64 `gorm:"type:float;not null"` |
| 61 | BasicAuthSalt string `gorm:"type:string"` |
| 62 | TokenVersion int `gorm:"type:int;default:1"` |
| 63 | } |
| 64 | |
| 65 | type TwitterIDs struct { |
| 66 | BlueskyID string `gorm:"type:string;not null"` |
nothing calls this directly
no outgoing calls
no test coverage detected