(c *fiber.Ctx)
| 116 | } |
| 117 | |
| 118 | func VerifyCredentials(c *fiber.Ctx) error { |
| 119 | my_did, pds, _, oauthToken, err := GetAuthFromReq(c) |
| 120 | |
| 121 | if err != nil { |
| 122 | return MissingAuth(c, err) |
| 123 | } |
| 124 | |
| 125 | userinfo, err := blueskyapi.GetUserInfo(*pds, *oauthToken, *my_did, false) |
| 126 | |
| 127 | if err != nil { |
| 128 | fmt.Println("Error:", err) |
| 129 | return c.Status(fiber.StatusInternalServerError).SendString("Failed to fetch user info") |
| 130 | } |
| 131 | |
| 132 | return EncodeAndSend(c, userinfo) |
| 133 | } |
| 134 | |
| 135 | // GetAuthFromReq is a helper function to get the user DID and access token from the request. |
| 136 | // Also does some maintenance tasks like refreshing the access token if it has expired. |
nothing calls this directly
no test coverage detected